简体   繁体   English

如何没有/一个窗口标题和任务栏的其他标题?

[英]How to have no/one window title and have a different title for the task bar?

Windows Explorer in Windows 7, and maybe Vista too (can't rememmber), does not have a title in the window. Windows 7中的Windows资源管理器,也许还有Vista(无法记住),在窗口中都没有标题。 but does have a title (some text) in the taskbar. 但在任务栏中确实有标题(一些文本)。

Is this possible to reproduce in C# (wpf or winforms)? 是否可以在C#中复制(wpf或winforms)? either through the framework or introp. 通过框架或Introp。

I want to have a window that says "Options" in the taskbar but the window itself doesn't have a title. 我想要一个在任务栏中显示“选项”的窗口,但该窗口本身没有标题。

MSDN上有一篇不错的文章,名为“ 使用DWM定制窗口框架” ,讨论了可以使用Vista和Windows 7的DWM使用窗口框架进行操作的过程。特别是,“ 删除标准框架”部分应与您的情况有关。

请在http://blogs.msdn.com/wpfsdk/archive/2008/09/08/custom-window-chrome-in-wpf.aspx中查看“ Vista资源管理器–从标题栏中删除冗余信息”部分

Simply add the following attribute to the Windows element in your .xaml file 只需将以下属性添加到.xaml文件中的Windows元素

WindowStyle="None"

Side notes: Task Manager can have a title bar or not have a title bar, depending on what mode you have it in; 注意事项:任务管理器可以具有标题栏,也可以没有标题栏,具体取决于您所处的模式。 double click on the margin to toggle the mode. 双击边距以切换模式。 Also note, the quickest note to bring up Task Manager is Ctrl+Shift+Esc. 另请注意,调出任务管理器最快的注意事项是Ctrl + Shift + Esc。 Also check out the BorderThickness and WindowsState attributes of the Window element. 还要检查Window元素的BorderThickness和WindowsState属性。

Credit to the Particle Effects Example in WPF MSDN docs. 感谢WPF MSDN文档中的“粒子效果示例”。

Have you noticed a Property of the WPF Window: 您是否注意到WPF窗口的属性:

ShowInTaskbar: Gets or sets a value that indicates whether the window has a task bar button. ShowInTaskbar: 获取或设置一个值,该值指示窗口是否具有任务栏按钮。 This is a dependency property. 这是一个依赖属性。

I think this may be helpful. 我认为这可能会有所帮助。 You can set WindowStyle Property to "None" with the ShowInTaskbar Property set to "True". 您可以将ShowInTaskbar属性设置为“ True”,将WindowStyle属性设置为“ None”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM