Please help a Windows Forms Dummy

T

theintrepidfox

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.
 
G

Guest

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...
 
P

Paul

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top