Closed Thread
Results 1 to 5 of 5

Thread: Work with many windows in winforms

  1. #1
    someone1234 is offline Newbie
    Join Date
    Jan 2010
    Posts
    5
    Rep Power
    0

    Work with many windows in winforms

    Hello,

    I would like to know how i can work in Winforms with more than 1 window.


    For example, after i press OK in a window, this window will be closed and another window will appear instead.


    thank you all.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    QuackWare is offline Learning Programmer
    Join Date
    Jan 2010
    Posts
    95
    Rep Power
    8

    Re: Work with many windows in winforms

    In the buttonclicked event you can write something like this:

    Code:
    //Show the second form.
    Form2 form2 = new Form2();
    form2.Show();
    //Close the previous form
    this.Close();
    The first 2 lines of course will be changed based on your form names

  4. #3
    someone1234 is offline Newbie
    Join Date
    Jan 2010
    Posts
    5
    Rep Power
    0

    Re: Work with many windows in winforms

    ok, thank you very much.

    i have another question, when the second window is shown, i can make there events when the button is clicked and etc. ?

    all the Forms are in the same project?


    thanks!!!

  5. #4
    so1i's Avatar
    so1i is offline Programming Professional
    Join Date
    Sep 2009
    Location
    Aberystwyth, United Kingdom
    Posts
    309
    Rep Power
    0

    Re: Work with many windows in winforms

    Quote Originally Posted by someone1234 View Post
    ok, thank you very much.

    i have another question, when the second window is shown, i can make there events when the button is clicked and etc. ?

    all the Forms are in the same project?


    thanks!!!
    Yep! You just do it in exactly the same way. Note, though, that if you want functions, constants or variables available across all your forms, it is best to create a module to stick them into.

  6. #5
    someone1234 is offline Newbie
    Join Date
    Jan 2010
    Posts
    5
    Rep Power
    0

    Re: Work with many windows in winforms

    Thank you very much for your help

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Enlarge the window in Winforms
    By someone1234 in forum C# Programming
    Replies: 3
    Last Post: 02-02-2010, 10:50 AM
  2. .NET Advantage Winforms
    By ahmed in forum C# Programming
    Replies: 0
    Last Post: 12-22-2009, 12:24 AM
  3. Suitable way to program with WinForms
    By sp3tsnaz in forum C# Programming
    Replies: 4
    Last Post: 12-05-2009, 10:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

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