Reopening a form ?

This is a discussion on Reopening a form ? within the C# Programming forums, part of the General Programming Boards category; i have a main form which has 2 login button.One of them is for duty and the other is for ...

  1. #1
    Registered User Aga^^'s Avatar
    Join Date
    Aug 2008
    Posts
    71

    Reopening a form ?

    i have a main form which has 2 login button.One of them is for duty and the other is for student. Once a clicked on one of them the related form is opened. But when i closed the related form and then i wanted to open the form again but it can not work. How can i fix it?

    it is the code which i can open the student form

    Code:
    StudentForm = new frmStudent();
    StudentForm.MainForm = this;
    StudentForm.Show();

  2. #2
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    call the .Show() method again. Declare your form in your classes scope so that way you can call it from any of its methods and it will be the same instance of the form (IE any data members on that form will still exist).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Calling datas from another form?
    By Aga^^ in forum C# Programming
    Replies: 2
    Last Post: 02-06-2009, 02:17 AM
  2. Windows Form App as parent, Directx as child??
    By yetti82 in forum C++ Programming
    Replies: 3
    Last Post: 05-29-2006, 04:04 AM
  3. Accessing main form from functions in other classes
    By pj_martins in forum C++ Programming
    Replies: 1
    Last Post: 11-05-2004, 09:27 AM
  4. My UserControls dissapear off my form
    By zMan in forum C# Programming
    Replies: 2
    Last Post: 09-15-2004, 09:55 AM
  5. Making an MFC form to suit
    By TJJ in forum Windows Programming
    Replies: 1
    Last Post: 04-17-2004, 12:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21