|
-
Jun 22nd, 2000, 01:23 AM
#1
Thread Starter
New Member
Lets say I want to go from Form1 to Form2 via Next button
I try to
Private Sub cmdNext_Click()
Unload Form1
Load Form2
End Sub
But only form1 unloads and nothing else happens
Please help a newbie
-
Jun 22nd, 2000, 01:25 AM
#2
-
Jun 22nd, 2000, 01:41 AM
#3
Frenzied Member
Show the form.
When you Load a Form, the Load Subroutine is invoked. In that subroutine, you should request that Form be shown (Use "Form1.Show" if "Form1" is name of your Form).
I think you can show the form without loading it (VB will load it automatically), but this is not a good idea. There are usually some things you want to do when form is loaded, so you will want to write Code in the Load Subroutine. Start with just "Form1.Show" as the only code, and go on from there.
VB sets TabIndex Values in the order you put Controls on the Form. You can override these values at Design Time, but it tends to be more convenient to do it at Run Time in the Load Subroutine. There are various other initializations conveniently taken care of in the Load Subroutine.
Good luck with VB
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
-
Jun 22nd, 2000, 09:59 AM
#4
PowerPoster
May be you can just Hide the Form
You also can do it in this way too
Code:
Private Sub cmdNext_Click()
Form1.Hide
Form2.ShoW
End Sub
Private Sub cmdNext_Click()
Form1.Show
Form2.Hide
End Sub
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
|