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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top