子窗口的控制按钮被dockpanel控制,MaximizeBox属性不管用,
修改dockpanel控件源代码,找到项目中的文件FloatWindow.cs
在240行左右有这样的代码,中间标红的部分是修改的部分,这样修改后,在浮动窗口的情况双击标题栏是最大化/最小化,而不是缩回去
else if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDBLCLK) //双击消息事件
{
uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result != 2)
// HITTEST_CAPTION
{
base.WndProc(ref m);
return;
}
DockPanel.SuspendLayout(true);
// Restore to panel
foreach (DockPane pane in NestedPanes)
{
if (pane.DockState != DockState.Float)
{
continue;
}
//pane.RestoreToPanel();
Form form = (Form)System.Windows.Forms.Form.FromHandle(this.Handle);
if (form.WindowState != FormWindowState.Maximized)
{
form.WindowState = FormWindowState.Maximized;
}
else
{
form.WindowState = FormWindowState.Normal;
}
}
DockPanel.ResumeLayout(true, true);
return;
}
[
本帖最后由 xydddaxia 于 2014-1-8 17:20 编辑 ]