Hi,
I have a C# program with 2 forms:
* When form 2 shows, 2 timers are disabled and the lbl.text functions are changed on form 1
* When form 2 is hidden, these functions should be changed back.
* I have written a function within form 1 to change it back, the code runs through the function but the changes are not made
PLEASE HELP
Form 2 Code when hiding:
this.Hide();
WindowsApplication1.frmQ1 mf = new WindowsApplication1.frmQ1();
mf.load_Settings();
mf.restore();
restore() code:
public void restore()
{
timer.Enabled = true;
menuItem3.Enabled = false;
menuItem7.Enabled = true;
timer1.Enabled = true;
statusBar1.Text = "Ready";
lblLoad.Text = "Waiting for update";
}
The changes in restore() function do not occur
Best Regards
JJ Baird
Loading
Ryan AlfordPosted Dec 31, 2008, 9:25 AM
Form1 oldForm1 = Application.OpenForms["Form1"];
This will get the existing form from memory.
Mohamed HamdyPosted Dec 31, 2008, 6:56 AM
this line create a new instance :
WindowsApplication1.frmQ1 mf = new WindowsApplication1.frmQ1();
but what u want is to apply these properties to the current instance -in the memory- , try to keep it as a Class-level member , then u can deal with it .