Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reshow a child window

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
I have an application ... click a button and it pops up a child form using Show() (so non-modal) that provides additional information

Now... say you click your browser, then click back to my main window... I want to reshow the the child form.

Or say you minimize the child form to the taskbar, then reclick the button... I want to restore the childform just as if you had clicked it in the taskbar... and other actions that may happen, I basically want to bring it back.

Can't seem to do this well... best I did was on parent activate
Code:
childForm.Focus();
childForm.Visible();
this.Focus();

But that didn't work right as the parent focus became locked out (not really sure why) and the childForm was the only one which would take input.

I expected something like childForm.Restore(); but no such luck. Would appreciate some advice for how to achieve this.


 
I've switched to
Code:
childForm.WindowState = WindowFormState.Normal;
childForm.Select();
this.Focus();

This takes care of my restore from taskbar difficulties, and works fine on my button press event.

But putting this on the parent activate event still causes that odd parent gets locked out of being able to receive focus.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top