WPF:删除标题/控制箱 [英] WPF: Remove the title/control box
问题描述
我刚刚切换从的WinForms到WPF和WinForms的去除整个标题框很简单,只需设置标题=和控制框=假的。
I've just switched over from WinForms to wpf and in WinForms removing the whole title box is very simple, just set the title="" and ControlBox=false.
现在有一个如何用WPF做了许多建议,所有的人都使用原生Win32调用。 虽然他们做拆下控制箱,他们仍然留下一个较厚的边框顶部。
Now there's many suggestions on how to do this with wpf, all of them using native Win32 calls. Although they do remove the control box, they still leave a thicker border at the top.
我敢肯定这是可行的使用某种本地通话,但如何?
I'm certain it's doable using some kind of native call, but how?
推荐答案
好了,试试这个
WindowStyle="none"
是这样的:
<Window x:Class="Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" WindowStyle="None"
MinHeight="350" MaxHeight="350" MinWidth="525" MaxWidth="525">
<Grid>
</Grid>
</Window>
编辑:
这看起来有点愚蠢的,但这种方式(与MIN-和了maxHeight /宽相同的尺寸),你可以prevent窗口从beeing调整
It looks a little stupid but this way (with Min- and MaxHeight/Width at the same size) you can prevent the window from beeing resized
这篇关于WPF:删除标题/控制箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!