Hi Dan,
Now I understand your question. I reread your original question and I should have figured it out. Just change your syntax to the following:
textBox1.DataBindings.Add(new Binding("text", this, "PortNumber"));
>Cathi,
>
>Thanks for answering. I don't think I made it clear what my intentions were. I want to bind the text box to a property of the form. No dataset is involved. I'm sure I've done this before (at least I think I have) but I can't find the code or remember how.
>
>Thanks,
>Dan
>
>>Hi Dan,
>>
>>The syntax is the typically the following:
>>
>>
>>textBox1.DataBindings.Add("Text",MyDataSet,"MyTable.PortNumber");
>>
>>
>>>Can anyone help me with a problem of binding a textBox to a form property?
>>>
>>>I have:
>>>
>>>textBox1.Bindings.Add(new Binding("text", this, "PortNumber"));
>>>
>>>I does not seem to work. I've done it before but I can't remember how.
>>>
>>>Thanks,
>>>Dan
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi