Minimizing and then Maximizing my application prevents windows from appearing!

F

Flyte

Hi All - I have a problem that I cannot for the life of me solve. I
hope someone can help me out.

..NET 2.0 / C#

I have an application that is a touch screen application, and as such,
I have a main window that is borderless and its initial WindowState
is set to Maximized.

On top of this main window, I have 3 additional windows that are placed
in specific positions calculated using the Screen.PrimaryScreen.Bounds.
All of these windows have their Owner property set to be the main
window.
(Not sure if this info is relevant)

Because I do not have a form border, I offer a "Minimize" button that
when clicked sets the WindowState of my main window to
FormWindowState.Minimized. When the user maximizes the
application (either by ALT-TAB or clicking it on the task bar), it
maximizes fine, but ---sometimes--- dialogs and forms that I Show()
will no longer appear. I believe that the dialog did indeed show,
but it is behind my main form. This I find wierd because on every
dialog and form that I use, it's owner is set to be the main window.

Further, and what is even more confusing, is that when this strange
problem occurs, not only can I not bring up any dialog from my
application, but I can no longer "ALT-TAB" any other application
(i.e.: Windows Explorer, IE, etc.) to bring it into view. When I select
it via ALT-TAB or by the task bar, it gets selected, but nothing seems
to be able to appear on top of my main window.

I am lost and it seems that Windows itself is having issues on bringing
a window or application to the top of the Z order.

Does anyone have any suggestions?
 
F

Flyte

well.. oddly enough... setting the main window's TopMost property to
false everytime the
SizeChanged event fires and the WindowState == Maximized, seems to have
solved this.
 

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

Top