K
Kimmo Laine
Hi!
Is there a way to generate Load-event for form without showing it?
My problem is that if i try to set control states before Load is raised,
control states may or may not work. Here is some code:
Lets say that i have 2 form - form1 and form2. In form1 i have a button.
When this button is pressed i will display the other form:
void button1_Click(object sender, EventArgs e) {
Form2 f = new Form2();
f.DoSomething();
f.Show();
}
In form2 i have 2 controls, button and a checkbox. If i do like this in
DoSomething-method...
public void DoSomething() {
button1.Visible = true;
checkBox1.Visible = button1.Visible;
}
....checkbox1 will be hidden! Is there a way to solve this?
tthx
-Kimmo
Is there a way to generate Load-event for form without showing it?
My problem is that if i try to set control states before Load is raised,
control states may or may not work. Here is some code:
Lets say that i have 2 form - form1 and form2. In form1 i have a button.
When this button is pressed i will display the other form:
void button1_Click(object sender, EventArgs e) {
Form2 f = new Form2();
f.DoSomething();
f.Show();
}
In form2 i have 2 controls, button and a checkbox. If i do like this in
DoSomething-method...
public void DoSomething() {
button1.Visible = true;
checkBox1.Visible = button1.Visible;
}
....checkbox1 will be hidden! Is there a way to solve this?
tthx
-Kimmo