打造“帮手” WPF 中的窗口
我正在 WPF 中编写一个应用程序,想要制作一个“帮助器”窗口。窗口需要调整大小,没有最小化选项,并且不会显示在任务栏中。如果应用程序获得焦点,它也应该出现,但无论它是在主窗口的前面还是后面,都应该保留。当主窗口关闭时,它应该与应用程序一起关闭。
一个示例是 Visual Studio 中的分离窗格。
我已经使帮助程序窗口不出现在任务栏中,但无法获得我想要的其余行为。如果它们是自己的窗口,则它们不会与应用程序的其余部分一起获得焦点。如果我指定主窗口作为其所有者,则主窗口不能位于辅助窗口之上。
有人知道解决这个问题的好方法吗?
I'm writing an app in WPF and want to make a "helper" window. The window needs to be resizable, with no minimize option and doesn't show in the taskbar. If the app receives focus, it should appear as well, but whether or not it's in front or behind the main window should be retained. When the main window is closed, it should close along with the app.
An example is a detached pane in Visual Studio.
I've made the helper windows not appear in the taskbar, but can't get the rest of the behaviors I want. If they're their own windows, they don't get focus along with the rest of the app. If I specify a the main window as their owner, the main window can't be on top of the helper window.
Anyone know a good way to approach this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在寻找类似“无模式”对话框的东西。我不使用 WPF,但这里的描述似乎非常简单。
http://msdn.microsoft.com/en-us/library/aa969773。 ASPX
I think what you are looking for is something like a "modeless" dialog box. I don't do WPF, but the description here seems pretty straightforward.
http://msdn.microsoft.com/en-us/library/aa969773.aspx
你可以尝试这样的事情:
无论你想如何显示它,都会有这样的效果:
它可调整大小,没有最小化选项,不会显示在任务栏中,当应用程序获得焦点时出现,与主窗口一起关闭......它唯一不做的事情是t cover 允许这些工具窗口位于主窗口后面。
You could try something like this:
and however you want to show it, something to this effect:
its resizable, has no minimize options, doesn't show in the taskbar, appears when the app gets focus, closes with the main window... the only thing it doesn't cover is allowing these tool windows to be behind the main window.