Hi everyone,
Im currently trying to get a hold on programming windows forms using c# and im having trouble doing alot of the simple stuff i want to do, one of things i want to get going is updating the contents of a textbox with the values of a variable everytime the change say i change a string variable i want the change to be reflected in a textbox on another form automatically also where do i put variable to be used on multiple forms
cheers
-Tristan
Loading
Tristan CartledgePosted Aug 14, 2007, 2:30 AM
the class i have is
similar to this
class server
{
string name;
string ip;
}
cheers again
-Tristan
Jan MontanoPosted Aug 14, 2007, 1:53 AM
One approach would be defining a property.
private string myVariable;
private string MyVariable
{
}
MyVariable = "new value" // this will make your textbox's value change also
You must define Form2.textBox1 as public so that you'll be able to access it from another form.