Page 1 of 1

Visual Basics 6 Tutorial *making your form open other forms*

Posted: Mon Jan 31, 2005 3:45 pm
by Cheech|N|Chong
This is my first tutorial with VB:

Purpose:
To teach you how to make your program open another form you have made with a command button


Ok lets start!
1.First make your form and name it whatever your little heart desires, add a caption, and so forth.
2. Create a Command Button and place it somewhere on the form, for the Command button edit the caption to "Open The Other Form":

Image

Image

3. Now its time to create a new form inside of the main form:
Image

After you click Add Form a window will appear asking you what type of form you want to add. Under the tab "New" Click "Form" and then "Open"

Image

After this, a new blank form will appear.

4. At this time you don't need to put anything on it because i'm not making a tutorial on making a program just how to open seperate forms, so you can leave the new form blank.

5. Name the NEW form "frmTwo" without the parenthesis.

Image

6. Now go back to the main form by double clicking in the form panel:

Image

7. Now double click on the command button you made with the caption "Open The Other Form" and type this:

Code: Select all

frmTwo.Show
Ok, right here frmTwo is the name of the second form you made (look back at step 5 if in doubt) the ".Show" procedure tells the program to do exactly that, SHOW frmTwo.
[/color][/b]
This conclused my tutorial hope you guys who didn't know how to do this now do, thank you.

Posted: Mon Jan 31, 2005 4:03 pm
by Locke
Nice tut
*Sticky

Or you could use the command

Code: Select all

form2.visible = true
They both work though

Posted: Mon Jan 31, 2005 4:46 pm
by Cheech|N|Chong
bwahaha my first little sticky, thanks! 8)

Posted: Fri Feb 04, 2005 1:10 pm
by Thebirthdayhat
nice tut, btw how did u get the curser in the screenshot?

Posted: Sun Feb 13, 2005 10:59 am
by Cheech|N|Chong
Thebirthdayhat wrote:nice tut, btw how did u get the curser in the screenshot?
uhh...didnt disable it on my SS program?

Posted: Fri May 20, 2005 6:27 am
by Phenomena
or you can use

Code: Select all

Load frmTwo
thats the way i like to do

Posted: Sun May 29, 2005 5:22 pm
by Ironahand08
I think it is Visual Basic, not Visual Basics