开发者

My WindowsFormsApplication going behind of all application

开发者 https://www.devze.com 2023-02-14 07:49 出处:网络
I developed a WindowsFormsApplication having a Form of Border Style as \"FixedToolWindow\", now the problem is while I am going to minimize开发者_开发问答 any other opened application then my applicat

I developed a WindowsFormsApplication having a Form of Border Style as "FixedToolWindow", now the problem is while I am going to minimize开发者_开发问答 any other opened application then my application going behind of all the application opened already. I am not getting where the problem is exactly. So can anybody help me to find out where the problem and how to short out it ?

Any help will be appreciated. Thanks in Advance


The problem is called Z order, which is the internal top-to-bottom ordering of the windows that appear on the screen maintained by Windows.

When you click on that other application to minimize it, it becomes the "active" application and its window is moved to the foreground. That pushes your application (which used to be the foreground window) into the background, behind the other application. That causes its window to be hidden or obscured behind the window of the other application. Clicking on your application's window will bring it to the foreground again, causing it to cover up any windows that lie behind it.

But in answer to your real question, no, you should not have specified "FixedToolWindow" for the BorderStyle of your application's main window. Windows with that border style do not appear in the taskbar and are not treated as the main window of an application. That style is intended for tool windows, such as floating palettes, displayed in addition to an application's main window.


If your form is intended to be a tool window then perhaps you would like it to appear above all other forms when shown.

Therefore, set it's TopMost property to True.

Otherwise, I agree with Cody Gray, no main form should have a FixedToolWindow border style.

0

精彩评论

暂无评论...
验证码 换一张
取 消