Have one window close another window.

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

I have an app that opens a main window. There's a condition where another
window will open and from that window I want to be able to close the first
window.

How do I do this?

TIA - Jeff.
 
You overload the constructor method of the second window this way :
public SecondForm(Form ParentForm)
{
Initialize();
[...]
}
This way you have an pointer to handle the first form from the second one
and call Close() or anything else (if public).
Don't forget to call the Initilize method within it.
 
Back
Top