DOes anyone know how to pause execution in one form/method until another form/method is through then finish its own program. I want to be able to switch to another form, run some execution, then take the results to pass back to the original form and let it finish execution. WHen I try it, it will switch over and even pass info back, but the original form will fishish its sub-routine with out waiting for the results. Know it sounds confusiong.

How to pause execution in a Form?
bakusek
-Joe
Bhavin B
In .NET you can call any method asynchronously using the BeginInvoke and EndInvoke commands and register callbacks which trigger when the method completes and a result is available. See if this fits in for what you are trying to do:
1. Asynchronous programming in .NET
2. Sample
Regards,
Vikram
xinpis
What is sounds like is that you want to display a form in front of another and then pass the results of the new form back to its owner.
Have a look at the Form.ShowDialog() method, like so:
Dim value As Integer
Using form As New MyForm
form.ShowDialog()
value = form.Results
End Using
Sankar07
In Form1:
Dim form1Var as Integer = 0
Dim form2Var As Integer = 0
Do Until form1Var = 100
form1Var += 1
Loop
form2Var = Form2.DoSomething()
MessageBox.Show("Value of form1Var is: " + form1Var.ToString)
MessageBox.Show("Value of form2Var is: " + form2Var.ToString)
In Form2:
Public Function DoSomething() As Integer
Dim i As Integer = 0
Do Until i = 200
i += 1
Loop
Return i
End Function
Hope this is what you were looking for.
-Joe