如何使窗外的节目始终设置为顶部 [英] How to make the window out of the show always set the top

查看:76
本文介绍了如何使窗外的节目始终设置为顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Showdialog是一个模态窗口,阻止从其主窗口弹出的消息。 Show是一个非模态窗口。当它弹出时,它的主窗口消息不会被屏蔽。如何让窗外的节目始终设置为顶部,主窗口消息没有屏蔽?



我尝试过:



i不知道如何做这个功能。

Showdialog is a modal window, and messages popping up from its main window are blocked. Show is a non-modal window. When it pops up, its main window message is not masked. How to make the window out of the show always set the top, and the main window message is not shielded?

What I have tried:

i don't konw how to do this function.

推荐答案

我不确定我理解问题,但也许你在问: Form.TopMost属性(System.Windows.Forms)| Microsoft Docs [ ^ ]
I am not sure I understand the question, but maybe you are asking about: Form.TopMost Property (System.Windows.Forms) | Microsoft Docs[^]


除了研究Richard的解决方案外,还要检查将表单的所有者属性设置为另一个表单的能力;这将保证拥有表格始终保持以上所有者表格。



设置表格'最重要的财产将保持表单位于所有其他应用程序窗口之上,即使另一个表单以模态显示(使用没有所有者窗口句柄的ShowDialog作为参数)。



但是,使用MessageBox,显示将出现在最顶层的窗口前面。



i几乎从未找到用于制作表格'Topmost。
In addition to studying Richard's solution, also examine the ability to set the 'Owner property of a Form to another Form; this will guarantee that the "owned" Form always stays above the "owner" Form.

Setting a Form's 'Topmost property will keep that Form on top of all other app windows, even if another Form is shown modally (using ShowDialog with no owner window handle as a parameter).

But, using MessageBox,Show will appear in front of a 'Topmost window.

i have almost never found a use for making a Form 'Topmost.


这篇关于如何使窗外的节目始终设置为顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆