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

Jan MontanoRank #1,295 · 1.3K reputationPosted Aug 13, 2007, 9:53 PM EDT
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.
Tristan Cartledge3 reputationPosted Aug 13, 2007, 10:30 PM EDT
the class i have is
similar to this
class server
{
string name;
string ip;
}
cheers again
-Tristan