开发者

how to check if window is on top through "usercontrol"

how to check if win开发者_开发问答dow is on top through usercontrol

i would like to set focus on a button, when window in on top of all on the desktop.


Pretty vague. Focus stealing is something users dislike a lot and Windows actively prevents. Just implement the Activated event of the form and have the event handler set the focus.


The ContainsFocus property of a Form will tell you if the window has the focus of the UI. The default behavior of a window is to come to the top when it gets focus, but it may not be on top of ALL other windows if one or more windows on the desktop are set to be "always on top" (The Task Manager is a common window that has this property by default)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜