代码(为子窗口)如下,但最大化按钮仍然有效???this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.Menu = this.mainMenu1;
this.MinimizeBox = false;
this.Name = "MDIChild";
this.ShowInTaskbar = false;
this.Text = "MDIChild";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.ResumeLayout(false);

解决方案 »

  1.   

    该子窗口文件如下,为何最大按钮还有效呢??using System;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;namespace MDITextEditor
    {
    /// <summary>
    /// MDIChild 的摘要说明。
    /// </summary>
    public class MDIChild : System.Windows.Forms.Form
    {
    private System.Windows.Forms.RichTextBox richTextBox1;
    private System.Windows.Forms.MainMenu mainMenu1;
    private System.Windows.Forms.MenuItem menuItem1;
    private System.Windows.Forms.MenuItem menuItem2;
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.Container components = null; public MDIChild()
    {
    //
    // Windows 窗体设计器支持所必需的
    //
    InitializeComponent();
    //
    // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
    //
    } /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
    if(components != null)
    {
    components.Dispose();
    }
    }
    base.Dispose( disposing );
    } #region Windows Form Designer generated code
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    this.richTextBox1 = new System.Windows.Forms.RichTextBox();
    this.mainMenu1 = new System.Windows.Forms.MainMenu();
    this.menuItem1 = new System.Windows.Forms.MenuItem();
    this.menuItem2 = new System.Windows.Forms.MenuItem();
    this.SuspendLayout();
    // 
    // richTextBox1
    // 
    this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
    this.richTextBox1.Name = "richTextBox1";
    this.richTextBox1.Size = new System.Drawing.Size(292, 161);
    this.richTextBox1.TabIndex = 0;
    this.richTextBox1.Text = "richTextBox1";
    // 
    // mainMenu1
    // 
    this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
      this.menuItem1});
    // 
    // menuItem1
    // 
    this.menuItem1.Index = 0;
    this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
      this.menuItem2});
    this.menuItem1.MergeType = System.Windows.Forms.MenuMerge.MergeItems;
    this.menuItem1.Text = "文件(&F)";
    // 
    // menuItem2
    // 
    this.menuItem2.Index = 0;
    this.menuItem2.MergeOrder = 11;
    this.menuItem2.Text = "保存(&S)";
    // 
    // MDIChild
    // 
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    this.ClientSize = new System.Drawing.Size(292, 161);
    this.ControlBox = false;
    this.Controls.AddRange(new System.Windows.Forms.Control[] {
      this.richTextBox1});
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    this.MaximizeBox = false;
    this.Menu = this.mainMenu1;
    this.MinimizeBox = false;
    this.Name = "MDIChild";
    this.ShowInTaskbar = false;
    this.Text = "MDIChild";
    this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
    this.ResumeLayout(false); }
    #endregion
    }
    }