I have an interface I am using to get access to some of the objects on my
form: a textbox (Status) and my statusbar (StatusBar). In my class, which
is actually in another class from my form I have the following:
public interface IStatusDisplay
{
string Status { get; set; }
string StatusBar { get; set; }
}
In my class (which is the form), I have:
*****************************************
public partial class FieldSetup : Form, IStatusDisplay
.....
#region IStatusDisplay Members
string IStatusDisplay.Status
{
get
{
return Status.Text;
}
set
{
Status.Text = value;
}
}
string IStatusDisplay.StatusBar
{
get
{
return toolStripStatusLabel1.Text;
}
set
{
toolStripStatusLabel1.Text = value;
}
}
********************************************
In my form code I pass: this. In my other classes, I use:
void function(IStatusDisplay display)
{
display.StatusBar = "This is a test";
}
This works fine, except it won't return until you return from the function
( I am not threading this, at this point).
But in the form itself, I can do a this.refresh - but how do I change my
code so I can do a refresh from my other classes?
Thanks,
Tom