Using forms in VB Express

How do I move from one form to another. Can I use buttons. I would like to click on a button and go to another form.

Scott



Answer this question

Using forms in VB Express

  • smurfgbr

    Hi,

    I think your question is accidently a little misleading because of nomenclature..

    Shak is right a form is an object and a class. Classes occur in hierachies and a form is high up on the hierarchy, so it's hard to add a form to another control set and people are giving you the correct reponses.

    Lets say I'm in form1 and a instantiate a new button.

    Dim button as new button

    I can add button as a control form2 (a class)

    form2.controls.add(button)

    Button now appears on form2. But it is not a member of form2... form2 is now button's parent.

    I believe the difficulty here is that there is a nomenclatural struggle.

    :)



  • BBes

    Scott,

    Is your problem solved If yes then please go ahead and mark the reply you think is the answer for your post.Click on button "Mark as Answer" to mark reply as answer.

    thank you,
    Bhanu.



  • bugduc

    hi,

    DMan1 code Dim f as new form2 is class member, so your form2 is member of Form1

    i guess this problem occure because you add two method for the same button, add a new button to your form double click it and add

    f.showdialog to the new method

    hope this helps



  • jrx

    Dim f as New Form2

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

    f.showdialog()

    End Sub



  • Minh PC

    dim a as new form1

    a.show()

    thats all



  • Hollow.e

    The easiest method is to create the button and double click on it. Then use the My.Forms.[Form Name].Show() under the Private Sub for the Click Action. When you click your box the new form will open which is what I think you were trying to ask.
  • Anonymousandmad

    Hi again, how do I make a form a member of 'my' or a member of another form.

    scott Thanks


  • Caleb Widmer

    Thank you for responding. An error appears.

    Error 1 'Private Sub Button1_Click(sender As Object, e As System.EventArgs)' has multiple definitions with identical signatures. C:\Documents and Settings\Owner\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Form1.vb 3 17 WindowsApplication1

    No suggestions.


  • Using forms in VB Express