C# Issue when reading NET app.config values

55 Views Asked by At

I'm trying to read my saved configuration settings back into TextBoxes with

txtMailServer.Text = Properties.Settings.Default.MailServer;

But the text box contents are being prefixed with this text in front of the actual value...

System.Windows.Forms.TextBox, Text: the.mail.server

What is causing that?

1

There are 1 best solutions below

0
On

OK FIXED - still learning...! I simply needed to tag .Text on the end of the control when I was saving it. I made the assumption the Text attribute would be defaulted - not smart on my part. D'oh