Recieving data from a form?

fastHands

New member
Joined
Oct 18, 2006
Messages
4
Programming Experience
Beginner
Hello everyone,

I am trying to get one of my forms (frm1) to show another form (frm2) and then wait until the a button is clicked in frm2 to continue with the following code in frm1.
Here is an example:


Dim var1 as Integer
Dim frm2 As New frm2
frm2.Show()
var1 = var2

I want to pass the value of var2 to var1 when I click a button. var2 comes from frm2. What is happens instead is,frm1 shows frm2 and continues on to the next line (var1=var2). Can anyone help?
 
Add a public property in your second form. Use the ShowDialog method instead of Show method. When ShowDialog call in finished you get the value from the property.
 
Back
Top