Link to home
Start Free TrialLog in
Avatar of alexmac05
alexmac05Flag for United States of America

asked on

Easy C#.NET databinding question (to bind a string to a textbox) - very simple

C#.NET Visual Studio 2005 DataBinding  simple question. I have a class called TextParms and it has a get method and a field that returns a string.  I am using data binding to bind this to a text box, but what should be the value of the third parameter to get this to work?
TextParms tp = new TextParms(200, "Casablanca", Color.Beige);
Inside of the TextParms class I have a string holding "Casablanca"   public string m_strText;
Inside of the TextParms class I have a get method to return this string:  public string getString()

In order to bind the value of the string which will be Casablanca to this text box, what is the value I should place in the third parameter for the databinding.add method?  I can get this to work with null in the value and the ToString() method returning the string, but I need to figure out another way.
 textBox1.DataBindings.Add("Text", tbList, null);
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial