简体   繁体   English

删除WPF窗口的标题栏文本,但保留状态栏文本

[英]Remove title bar text of a WPF window but keep status bar text

I am working in Wpf with metro Window, is it possible to create a window which has text in the taskbar, but has no text in the title bar at the top of the application? 我在使用Metro窗口的Wpf中工作,是否可以在任务栏中创建一个包含文本的窗口,但在应用程序顶部的标题栏中没有文本?
Currently I am using <Controls:MetroWindow.LeftWindowCommands> and <Controls:MetroWindow.RightWindowCommands> for customize my title bar. 目前我正在使用<Controls:MetroWindow.LeftWindowCommands><Controls:MetroWindow.RightWindowCommands>来自定义我的标题栏。 I have attached images, that doesn't have title text. 我附上的图片没有标题文字。 在此输入图像描述在此输入图像描述 .
And below images have title. 以下图片有标题。 在此输入图像描述在此输入图像描述
Now my requirement is that can my application looks like in image 1 and looks like 4th image in task bar 现在我的要求是我的应用程序可以在图像1中看起来像任务栏中的第4个图像

Thanks for your help all. 谢谢你的帮助。

Try PInvoke Method. 尝试PInvoke方法。

[DllImport("user32.dll")]
    static extern int SetWindowText(IntPtr hWnd, string text);

On Window Loaded : 在窗口加载:

SetWindowText(new WindowInteropHelper(this).Handle, "Madan");

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

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