I was wondering how to hide the titlebar of a form but keep the original border, like e.g Dropbox does:
提前致谢!
Set FormBorderStyle
to FormBorderStyle.Sizable
or FormBorderStyle.SizableToolWindow
并设置Text
为空字符串,并且ControlBox
to false
注意FixedToolWindow
不起作用,它会删除边框。如果您不希望它很大,请使用SizableToolWindow
并将其添加到表单的代码隐藏中(添加两种语言,因为您没有指定并用两种语言标记问题):
在 vb.net 中:
Protected Overrides Sub WndProc(ByRef message As Message)
If message.Msg = &H84 Then ' WM_NCHITTEST
message.Result = CType(1, IntPtr)
Return
End If
MyBase.WndProc(message)
End Sub
In C#:
protected override void WndProc(ref Message message)
{
if (message.Msg == 0x0084) // WM_NCHITTEST
message.Result = (IntPtr)1;
else base.WndProc(ref message);
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)