将窗口保持在前景(即使它失去焦点)
在我的应用程序(C#、Windows 窗体)中,我有一个电话信息屏幕:如果有来电,则会显示一个窗口,其中包含呼叫者的附加信息。
该窗口应在前台打开,并且即使用户在另一个窗口中写入,也应保留在那里(因此用户仍然可以看到有关来电的信息)。
首先,我使用了 BringToFront - 但这并不是在所有情况下都有效(例如,当主应用程序不在前台时)。
现在我正在使用 BringToFront 和 user32.dll 函数 BringWindowToTop ->这是可行的,但如果窗口失去焦点,它就会在后台。
我如何实施这种行为?
In my application (C#, Windows Forms) I have got a telephone information screen: if there is an incoming phone call a window with additional information to the caller is shown.
This window should open in foreground and should stay there even if the user is writing in another window (so the user still sees the information regarding the incoming phone call).
First I've used BringToFront - but this didn't really work in all circumstances (e.g. when the main application was not in the foreground).
Right now I am using BringToFront and the user32.dll function BringWindowToTop -> which works, but if the window loses focus it is in the background.
How do I implement this behaviour ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您想将表单设置为 TopMost< /a>:
I think you want to set your form as TopMost: