那么您可以创建自己的表单(自定义表单),然后将该自定义表单继承到 mdi 子表单中
您必须将以下代码放在“自定义表单”中
public partial class BaseForm : Form
{
public BaseForm()
{
InitializeComponent();
StartPosition = FormStartPosition.WindowsDefaultLocation;
MaximizeBox = false;
Width = 806;
//Width = 850;
//Height = 760;
Height = 730;
//Width = 790;
//Height = 617;
}
//[DllImport("user32.dll")]
//[return: MarshalAs(UnmanagedType.Bool)]
//private static extern bool ShowScrollBar(IntPtr hWnd, int wBar, bool bShow);
//private enum ScrollBarDirection { SB_HORZ = 0, SB_VERT = 1, SB_CTL = 2, SB_BOTH = 3 }
protected override void WndProc(ref Message m)
{
const int WM_SYSCOMMAND = 0x0112;
const int SC_MOVE = 0xF010;
//ShowScrollBar(this.Handle, (int)ScrollBarDirection.SB_BOTH, false);
switch (m.Msg)
{
case WM_SYSCOMMAND:
int command = m.WParam.ToInt32() & 0xfff0;
if (command == SC_MOVE)
return;
break;
}
base.WndProc(ref m);
}
}
你必须而且应该把你的 mdi 子窗体minimum size to '0'
和 size to Width = 806; Height = 730;
我希望它会帮助你...