Not as simple as it looks

  • Thread starter Thread starter Gregory Khrapunovich
  • Start date Start date
G

Gregory Khrapunovich

I have a form that opens several modeless dialogs. Sometimes they become
covered by other (unrelated) applications and its annoying to click on each
dialog to make them visible again. I would like all dialogs to become
visible when main form becomes visible. Main form keeps pointers to modeless
dialogs.

Here is what I tried:
- Created an Activate event handler for the main form and inserted a call to
dlg.BringToFront(). The main form becomes not operational (it wouldn't react
to any commands).

- Put a call to dlg.BringToFront() in main form Paint event handler. It's a
little better, but main form stops reacting if dialog overlaps with it.

- Replace dlg.BringToFront() with dlg.Invalidate() to force repainting. Does
nothing (dialog stays covered.

- In the main for Activate or Paint handlers also call the base class. Does
nothing (Activate) or makes it worse (Paint)

Any ideas?

Gregory Khrapunovich
 
Thank you! It did the trick. It's even better than I hoped for - bringing
any form to front brings the others. Dream came true.
Gregory
 
Back
Top