CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2001
    Posts
    104

    Working with multiple forms

    hi all. I wanted to design a simple student registration system. in my design, i have 2 forms. Form1 consist of a ListView control displaying all the student information. Also, inside Form1 there is a button to Add new student. When a user presses the Add button, a new form will pops up which is the Form2. Inside form2 there are a lots of text boxes for users to input data. I would like to know how in Form1 that I could retrieve the data entered by the user in Form2. Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    make all member variables of Form2 as public that u want to access.

    and you can access as object members.

    paresh

  3. #3
    Join Date
    Nov 2000
    Location
    USA
    Posts
    179
    Hi!
    You can also make your TextBox public and use it in Form1. See attachment.
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    that's what I said in my early post. that's for the sample though. I am bit lazy these days

  5. #5
    Join Date
    Nov 2000
    Location
    USA
    Posts
    179

    Smile

    Hi!
    I think it is pretty good to be little busy. I just finished some project for client and now I have not any task.

  6. #6
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    so you can answer here some of the post and do some research


  7. #7
    Join Date
    Jan 2003
    Posts
    3
    Thanks for the code sample! I was entering
    "Form Form2 = new Form2();" not
    "Form2 Form2 = new Form2();"

    I couldn't figure out why none of my Form2 methods or variables were showing up! It wasn't an access level problem, it was that I was instantiating a generic Form and not my specific Form2!

    Just when I think I understand this stuff I make another newbie mistake that takes hours to figure out.

    Thank you for your help!
    Lash

  8. #8
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    if you have any problems then let us know here , any GURUS out here will figure out
    - Software Architect

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