那么你可以创建自己的表单(custome形式),然后inherite该自定义窗体为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;
我希望它会帮助你...
这只是不正确的方式来使用MDI。它只会阻碍你最大限度地保持孩子窗口。使用选项卡式界面或交换UserControls切换视图。 –
看看在计算器这个链接可以帮助你 [如何禁用在C#中的最小化按钮?] [1] [1]:http://stackoverflow.com/questions/319124/how-禁用最小化按钮在c – DeveloperX
您尝试停靠面板? – pushpraj