CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Location
    Pakistan(Skardu)
    Posts
    64

    Question passing value between forms

    Hi,
    I have winForm (form1 and form2)
    On Form1 I have Textbox (txtBox1 and form2 txtbox2 )
    On click of button I load form2 ie form2.showDialog() ..I have to display value entered in Txtbox2 in form1 textbox (txtbox1)
    NOTE : Form1 would be open first.. (How can i reload the form1 back again to show the txtBox2 value)

  2. #2
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: passing value between forms

    as long as you didn't dispose form2, its value stays there..

    in button click event:

    Code:
    dim frm as new form2()
    
    frm.showdialog(me)
    
    me.textbox1.text = frm.textbox2.text
    
    frm.dispose()
    hth
    Busy

  3. #3
    Join Date
    Dec 2004
    Location
    Pakistan(Skardu)
    Posts
    64

    Re: passing value between forms

    thank you soooo much

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

Featured