943,717 Members | Top Members by Rank

Ad:
Feb 8th, 2008
0

How would I get a form to appear in VB?

Expand Post »
I know this seems like a very noobish question and has probably been asked many times before, I'm trying to write a lottery program in which the numbers are generated, then you can check your numbers. There is a command button on the first form which says "Check Numbers" and this would take you onto the second form. Can anyone help me by telling me how to bring this up by clicking the command button? Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shotgunjoe is offline Offline
2 posts
since Feb 2008
Feb 8th, 2008
0

Re: How would I get a form to appear in VB?

type this code in your command button click event:

Form2.Show
Reputation Points: 28
Solved Threads: 71
Posting Pro
ryan_vietnow is offline Offline
578 posts
since Aug 2007
Feb 8th, 2008
0

Re: How would I get a form to appear in VB?

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Form2.Show
  3. End Sub

If you press the Command1 button it will automatically show the another form..
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
werks is offline Offline
57 posts
since Jan 2008
Feb 8th, 2008
0

Re: How would I get a form to appear in VB?

Great guys, thanks a lot! I appreciate it!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shotgunjoe is offline Offline
2 posts
since Feb 2008
Mar 20th, 2008
0

Re: How would I get a form to appear in VB?

To do what you want do the following
Private Sub Command1_Click()
Form2.Show
End Sub
NB: if you have given your second form a name write that name instead of form2
Hope i've helped.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
K-Dave is offline Offline
18 posts
since Jan 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: TitleBar
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC