|
-
Nov 22nd, 2000, 01:07 AM
#1
Thread Starter
Lively Member
I have just started VB programming.
I have a form at the start and some text boxes on it.
I have a command button at the bottom and when I press the command button i want it to load another particular form.
it is like making a command button linked to msgbox but i dont want msgbox. I want another sub form.
Thanks all!!
-
Nov 22nd, 2000, 01:26 AM
#2
Addicted Member
Is this what you are asking for?
Code:
--------------------------
'Make a CommandButton called cmdButton on the first form and copy this code onto the form.
'Make another form at design time, with the name frmAnother.frm
'Run the project and click cmdButton and the other form shows.
Private Sub cmdButton_Click()
Load frmAnother
frmAnother.Show
End Sub
-
Nov 22nd, 2000, 01:33 AM
#3
Frenzied Member
That is right, but you do not need "Load Form2".
Show is enough.
Code:
Private Sub Command1_Click()
Form2.Show
End Sub
-
Nov 22nd, 2000, 01:57 AM
#4
Thread Starter
Lively Member
Thank you for the help
I didn't expect help to arrive so shortly
thank you!!
-
Nov 22nd, 2000, 02:12 AM
#5
Thread Starter
Lively Member
How do i make it that when i load the second form the first form will disappear??
-
Nov 22nd, 2000, 02:41 AM
#6
Addicted Member
to hide the first window:
-
Nov 22nd, 2000, 02:42 AM
#7
Fanatic Member
Code:
Private Sub Command1_Click()
Load Form2
Form2.Show
Form1.Hide
Unload Form1
End Sub
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Nov 22nd, 2000, 02:43 AM
#8
Fanatic Member
You can also use
This way, the 2nd form is modal. So, you can't switch back to the 1st form, until FrmTwo.Hide.
(Like a normal Messagebox)
-
Nov 22nd, 2000, 03:15 AM
#9
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|