Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Databinding to a Textbox

Status
Not open for further replies.

link9

Programmer
Nov 28, 2000
3,387
0
0
US
Hello everyone,

I am using VS2005 and .NET 2.0, and I have a simple databinding question.

I have a textbox on a winform w/ the id, txtSampleSize1.

I also have a protected class variable of type, double, w/ the name: m_SampleSize1

I try to setup the binding between these two using the following statements:
Code:
txtSampleSize1.DataBindings.Add("Text", m_SampleSize1, null);
txtSampleSize1.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;

But then when I change the value of the textbox, the underlying m_SampleSize1 is not also changed. I thought that was the way it was supposed to work.

What am I missing here?

Thanks,
Paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top