Hi Ido!
Well i have several (20+) views with a custom base class. The base class
contains all kind of localiztion, security database and navigation related
virtual methods. The code which is displaying views looks something like
this
UIViewBase v = GetView(...);
// . . .
v.OnBeforeShow(...);
v.Show();
v.OnAfterShow(...);
// . . .
My problem is that if i place code in the virtual OnBeforeShow-method which
is setting control states (like the Visibility e.g.) and then im relying it,
the code doesn´t work when the view is displayed for the first time. Of
course i can code something that doesn´t use control states, lets say in
if-statements e.g., but i would rather not.
-kimmo
"Ido Samuelson" <is********@nana.co.ilwrote in message
news:A3**********************************@microsof t.com...
You can do
form.Show();
form.Hide();
before the call to the DoSomething method. However it is better if you
explain more what you are doing, it looks like you have a design issue.
Best,
Ido Samuelson
"Kimmo Laine" <re******@newsgroup.onlywrote in message
news:#t*************@TK2MSFTNGP06.phx.gbl...
>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