G
Guest
I've got a form that is opened on a button click as a dialog. It is called as
follows:
Form f = CoreFactory.GetInputForm(type);
f.ShowDialog();
Now, the form is created in the factory using a case statement and returns a
single instance. However, In order to close the form, i need to close it
twice, on two seperate clicks. Combining two this.Close() in the OnClick
event does nothing.
I got around this by using the following:
Form f = CoreFactory.GetInputForm(type);
f.Hide();
f.ShowDialog();
But this makes the screen flash minimise and maximise. I believe this
relates to an earlier problem I had, where all forms are automaticaly visible
on creation, which means, I have a form that is already visible, having
ShowDialog() run.
It's a work around, but it seems pretty stupid, why are all forms created
visible? Are there any solutions?
Cheers
Tris
follows:
Form f = CoreFactory.GetInputForm(type);
f.ShowDialog();
Now, the form is created in the factory using a case statement and returns a
single instance. However, In order to close the form, i need to close it
twice, on two seperate clicks. Combining two this.Close() in the OnClick
event does nothing.
I got around this by using the following:
Form f = CoreFactory.GetInputForm(type);
f.Hide();
f.ShowDialog();
But this makes the screen flash minimise and maximise. I believe this
relates to an earlier problem I had, where all forms are automaticaly visible
on creation, which means, I have a form that is already visible, having
ShowDialog() run.
It's a work around, but it seems pretty stupid, why are all forms created
visible? Are there any solutions?
Cheers
Tris