那麼你可以創建自己的表單(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