2

My application has many forms, there is also one more important form, that is the main form, the behaviour is in general ok but in same cases (for example when I open a file dialog from a subform) the beahviour is: subform is hidden and mainform is shown.

How to avoid this?

UnDiUdin
  • 14,924
  • 39
  • 151
  • 249

1 Answers1

1

Make sure you either implicitly or explicitly set the PopupParent of both the sub-form and the dialog. If you open both the sub-form and the dialog from some random bit of code somewhere and don't tell Windows about the correct Z-order, stacking issues can happen.

Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273