Results 1 to 5 of 5

Thread: Multiple Forms in a project

  1. #1
    dmartin17
    Guest

    Multiple Forms in a project

    How do I use multiple forms in c#. most importantly how do i get a second form to pop up and return information to the other form?


    (btw im trying to recrate an inputbox like thing)

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    create a new form class.

    yourform formtest = new yourform()

    formtest.Show()
    or .ShowDialog() for modal

    give the form a property you can you can check in the other form for whatever value you need to return.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    dmartin17
    Guest
    OK i created my second form. I now have a main form and an input form. When the input form comes to be shown i want it to not be able to be minimized or for the user to anyway switch back to the main form. I think i want this to be modal(if i use that term correctly) is there a way to do this?

  4. #4
    dmartin17
    Guest
    never mind i figured it out. all ihave to do is this
    Code:
    Form2 frm2 = new Form2();
    frm2.ShowDialog(this);

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    good boy.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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