dumb question

I am making the switch to VB.NET from VB 6. So here is a stupid question for you vets out there. When using multiple forms how to I go from one to the other. I used to just have a command button and a simple form2.show used to be all I need. Maybe it still is and I am doing something wrong. Please advise...

Comments

  • : I am making the switch to VB.NET from VB 6. So here is a stupid question for you vets out there. When using multiple forms how to I go from one to the other. I used to just have a command button and a simple form2.show used to be all I need. Maybe it still is and I am doing something wrong. Please advise...
    :

    You need to reference the old form in the new form, if you know what I mean... For instance, in Form2, in the declarations, put:

    Private FormOne = Form1.ActiveForm

    Then you can reference Form1 directly using the FormOne variable, althought the code will not autocomplete. For instance.

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

    FormOne.Text1.Text = "I have changed a Form1 variable from Form2"

    End Sub


    Hope this helps.

    Andy Kimbrey - Agile-IT

    mailto:andrew.kimbrey@agile-it.net

    ICQ:78749520

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion