S
sham
Hi to all,
I have an object that has a property numberOfFilesDeleted which is an
integer. I want to bind a label to it so that when the value changes, the
label gets updated on the screen.
I have used the following code to bind the text property of the label to the
object property.
private void WinForm_Load(object sender, System.EventArgs e)
{
label1.DataBindings.Add(new Binding("Text", directorySweepObj,
"numberOfFilesDeleted"));
}
When I do the following :
private void button1_Click(object sender, System.EventArgs e)
{
directorySweepObj.numberOfFilesDeleted =
directorySweepObj.numberOfFilesDeleted + 1
}
I would expect the label to be updated, but it is not.
What am I doing wrong?
Sham.
I have an object that has a property numberOfFilesDeleted which is an
integer. I want to bind a label to it so that when the value changes, the
label gets updated on the screen.
I have used the following code to bind the text property of the label to the
object property.
private void WinForm_Load(object sender, System.EventArgs e)
{
label1.DataBindings.Add(new Binding("Text", directorySweepObj,
"numberOfFilesDeleted"));
}
When I do the following :
private void button1_Click(object sender, System.EventArgs e)
{
directorySweepObj.numberOfFilesDeleted =
directorySweepObj.numberOfFilesDeleted + 1
}
I would expect the label to be updated, but it is not.
What am I doing wrong?
Sham.