943,524 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 2225
  • VB.NET RSS
Mar 2nd, 2005
0

silly Q...but i dont knw the answer !!!

Expand Post »
hey ppl, i know this is aa really daft Q, but i only started using vb.net this yr and im not that gud at it!

basically i wana know how to go from one form to another using a button, wud it just be sumthin as simple as:

Quote ...
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

btnSearch = frmSearch

endSub
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shelly121 is offline Offline
17 posts
since Feb 2005
Mar 14th, 2005
0

Re: silly Q...but i dont knw the answer !!!

No, you will need to create an object variable for the form you wish to open.

Somthing like this under the button sub should work:

Dim objNewForm as New NewForm()
objNewForm.ShowDialog()

Chester
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
cpopham is offline Offline
65 posts
since Mar 2005
Mar 16th, 2005
0

Re: silly Q...but i dont knw the answer !!!

Adding to what cpopham said, make a subroutine for one of your buttons like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

objNewForm.ShowDialog()

End Sub

Also make sure you put Dim objNewForm as New Form somewhere near the top. It should be "as New Form" and not "as New NewForm()"

That's in my version at least.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Khishin is offline Offline
23 posts
since Jan 2005

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 VB.NET Forum Timeline: I'm having trouble reopening projects.
Next Thread in VB.NET Forum Timeline: link text boxes with listbox





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


Follow us on Twitter


© 2011 DaniWeb® LLC