Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo

How to pass data between two forms? (Monday, January 31, 2005)






Found the following interesting discussion in the Newsgroups:

How to pass data between two forms?
by:Anonymous

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..

--
..NetHelpWanted


 Reply:
by:Ken Tucker [MVP]

 Hi,

Use ShowDialog to show the form instead of show

Ken
--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004



Posted by Xander Zelders





 
Previous Posts
    - .net remoting debug: break point doesn't stop on r...
    - How to pass Event Delegate as an argument
    - Session_end
    - Session_end
    - Variant Record Types
    - POP3 component comparison
    - How to get the printable area of the printer ?
    - How to check for mdac in deployment
    - How to thread Results
    - Question about RAM

Archives
    - 08/01/2004 - 08/08/2004
    - 08/08/2004 - 08/15/2004
    - 08/15/2004 - 08/22/2004
    - 08/22/2004 - 08/29/2004
    - 08/29/2004 - 09/05/2004
    - 09/05/2004 - 09/12/2004
    - 09/12/2004 - 09/19/2004
    - 09/19/2004 - 09/26/2004
    - 09/26/2004 - 10/03/2004
    - 10/03/2004 - 10/10/2004
    - 01/02/2005 - 01/09/2005
    - 01/09/2005 - 01/16/2005
    - 01/30/2005 - 02/06/2005
    - 01/01/2006 - 01/08/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland