Hi i got a program that have two forms..
it goes like this
Form1(my main form)
From2
Form2 will only show if it is called by form1,
basically when i start the program form1 is the only one there.
but whats weird is.. the timer inside Form2 is already running.
Anyone got an idea why this is happening?
UPDATE:
here the code i used
public partial class MainForm : Form, IMessageFilter
{
public Form2 f2 = new Form2();
}
public void ShowForm2()
{
f2.Show();
}
When you said:
Is it like this:
You should not do that, else you should create an instance of Form2 when needed, like this:
Now you are sure that the instance will exist only when the message is received and will avoid to running the timer in Form2 if it is hidden.