Franck wrote:
I'm a vb programmer but i have to touch C# a bit now. I'm looking for
a thing that doesn't seems to exist anywhere here im talking of how to
open a form.
in vb it was just frmMyform.show or frmMyform.load and after showing
it.
And in VB, how did you initialize the variable "frmMyform"?
Ive search the web for that and it always came out with like 2 to 5 of
code lines that's completely stupid
i have tred all them and they all create a brand new form that doesnt
even exist and never manage to open my form. It seems that everyone is
building their form at runtime.
Even in VB, your form doesn't exist until runtime. How could it?
VB may be hiding the instantiation of the Form-derived class from you.
It may put the reference to the instantiated class in a global variable
for you. But rest assured, there's no form until you run your program.
here's the one that i was thinking it would have work but no
frm frmResults = new frm();
frmResults.show();
This is the usual way to instantiate _and_ show a form.
You are not very clear on what about the above code doesn't work for
you. But if you want to simply show a previously hidden (but not closed
or disposed) instance of a form, the simple answer is that you need a
reference to that form somewhere.
How you do this is up to you. There have been a number of threads on
this very concept in this newsgroup, so Google Groups should be able to
help you out there.
If you are having a problem other than simply obtaining the reference to
a form instance that already exists, then it would help for you to ask
your question in a more specific way. A concise-but-complete example of
code demonstrating your problem would be helpful.
Pete