Results 1 to 4 of 4

Thread: Sharing info between forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    1

    Sharing info between forms

    I have a question, I have to make a few programs for my class which I can't find decent documentation in my book for (ITT Tech, go figure)

    Say I have my main form (Form1), when you press a button on form1, it opens a new form (form2) that has a text input box, you enter a number, it does its calculation and must send it's calculation to a label box in Form1. how do I do this? And does this work the same way for outputting it in a listbox (insted of a label box)?

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Sharing info between forms

    do a forum search, this question is asked almost daily and has been answered over and over.

  3. #3
    Fanatic Member Slaine's Avatar
    Join Date
    Jul 2002
    Posts
    641

    Re: Sharing info between forms

    You can see my solution to this commom problem here:

    http://www.vbforums.com/showthread.p...54#post2349054

    Hope that helps.
    Martin J Wallace (Slaine)

  4. #4
    Registered User RaviIntegra's Avatar
    Join Date
    Mar 2007
    Location
    Pondicherry, India
    Posts
    125

    Re: Sharing info between forms

    vb Code:
    1. 'Write this code in form1, button1_click event        
    2. Dim frm As New Form2
    3. frm.Show()
    4.  
    5. 'Add a textbox and a command button in form2 and write the following code in form2 button_click event
    6.  
    7. Dim frm As New frmAddCtrl
    8.         frm.Show()
    9.         frm.Label1.Text = TextBox1.Text
    10.         Me.Hide()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width