Hi,
I am a web programmer but new to doing windows application. I have a windows form with a button controls and I want a situation where when a user click a particular button it will load another form. Pls advise.
Kind regards.
Femi
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
FroglegPosted Dec 21, 2010, 1:57 PM
1: Add additional forms
2: Add a module and within that module put -
Public Fm1 as Form1
Public Fm2 as Form2 and so on
In form load event of each form put - "Fm1 =Me","Fm2=Me" and so on
In the form1 button put
If Fm2 Is Nothing = True Then
Dim Fm2 As New Form2
Fm2.Show()
Else : Fm2.Show()
End If
This will load only one instance of form2 - note to keep form2 active in your project you will have to hide it rather than using
Close()
Put a textbox onto form1 and a label and button on form2
in form2 button event put - Label1.Text = Fm1.Textbox.Text
now you can see how data is transfered