By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,332 Members | 1,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,332 IT Pros & Developers. It's quick & easy.

Please help a Windows Forms Dummy

P: n/a

Dear Group

My apologies for the pretty basic questions following. Feeling like an
idiot. Tried finding out from MSDN and Groups but still not wise. I'll
worship your replies and be grateful for information about resources.

Thanks very much for your help and efforts!

Martin

Simple Case:
Application with three forms, Form1 as startup. Each form contains two
buttons for the purpose to display one of the other two forms.
E.g. clicking on button ShowForm2 on Form1 will display Form2 and hide
Form1.

Now I wonder:
What do I put in the ShowForm1 Button_Click event to show Form1?
I saw examples of declaring a New Form1 but then I end up with two.
If I say Form1.ActiveForm then an exception is thrown.

The other thing is do I load all forms when the application starts and
hide them till needed? Seems to me like a waste of resources.

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
hi, i think you must to put

dim myForm as new form2
myform.show

if you put me.close then all the application shut down... but you can put
the me.hide()
we better wait that somebody come with the truth...
"th************@hotmail.com" wrote:

Dear Group

My apologies for the pretty basic questions following. Feeling like an
idiot. Tried finding out from MSDN and Groups but still not wise. I'll
worship your replies and be grateful for information about resources.

Thanks very much for your help and efforts!

Martin

Simple Case:
Application with three forms, Form1 as startup. Each form contains two
buttons for the purpose to display one of the other two forms.
E.g. clicking on button ShowForm2 on Form1 will display Form2 and hide
Form1.

Now I wonder:
What do I put in the ShowForm1 Button_Click event to show Form1?
I saw examples of declaring a New Form1 but then I end up with two.
If I say Form1.ActiveForm then an exception is thrown.

The other thing is do I load all forms when the application starts and
hide them till needed? Seems to me like a waste of resources.

Nov 21 '05 #2

P: n/a
Never apologize for asking questions. I've been coding in VB.Net for years
and still end up having to ask basic questions on a regular basis (just
posted one!), because there's always something I haven't done or a part of
the framework I haven't explored, or an answer I can't find using help or
google. Learning is all about being willing to acknowledge ignorance in
yourself, no matter how much you already know, for the sake of finding
answers. Welcome to the path we all tread daily.

You seem pretty new, and I'm not sure I understand what you don't
understand, but to display a form -

Dim frm as new Form2
frm.Show

I could get into a huge, huge heap of things you need to understand beyond
this - but my advice to you is use Google to download samples of code to get
you started, and you can see for yourself how things are done.

I found this link googling "vb.net tutorial":
http://samples.gotdotnet.com/quickstart/winforms/

There is a ton of VB.Net code out there for you to download and play with,
you just have to look.

HTH,
Paul

<th************@hotmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...

Dear Group

My apologies for the pretty basic questions following. Feeling like an
idiot. Tried finding out from MSDN and Groups but still not wise. I'll
worship your replies and be grateful for information about resources.

Thanks very much for your help and efforts!

Martin

Simple Case:
Application with three forms, Form1 as startup. Each form contains two
buttons for the purpose to display one of the other two forms.
E.g. clicking on button ShowForm2 on Form1 will display Form2 and hide
Form1.

Now I wonder:
What do I put in the ShowForm1 Button_Click event to show Form1?
I saw examples of declaring a New Form1 but then I end up with two.
If I say Form1.ActiveForm then an exception is thrown.

The other thing is do I load all forms when the application starts and
hide them till needed? Seems to me like a waste of resources.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.