How to pass data between two forms?

G

Guest

Hi..

I have an application in which i have two forms. Form1 and form2.

Am able to pass the data to form 2. The below is the code snippet am using.

Private Sub directorytree_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles directorytree.DragDrop



Dim otherForm As New frmmnuAction(Me) ' Calling frmmnuactions to give user options.


otherForm.Show() ' otherForm is an instance of frmMnuActions

MsgBox(otherForm.Mnuaction.Text) '<------------- Wait till the above process completes.

'Display the Value From Form2 and then go to Exit Sub

Exit Sub

Now Form2 displays. The problem now for me is that.

I want to wait till I get a value back from form2 to the message box in Form1. And the Exit the directorytree_DragDrop

Please Help..
 
K

Ken Tucker [MVP]

Hi,

Use ShowDialog to show the form instead of show

Ken
---------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top