本人想做一个mdi程序
1、想在程序打开时就显示一个由splitContainer分割的主界面,要永远显示;splitContainer是停靠在mdi窗口中的。
2、当我打开其它窗口时,其它窗口始终在splitContainer后面,无法显示到前端。
若要加上注释部分则splitContainer消失。请问怎么解决这个问题
        private void tsmi5Min_Click(object sender, EventArgs e)
        {
            FiveMinuteLog minlog5 = new FiveMinuteLog();
            minlog5.MdiParent = this;
            minlog5.WindowState = FormWindowState.Maximized;
            minlog5.Show();
            minlog5.BringToFront();
            minlog5.Focus();
           // splitContainer1.SendToBack();
        }

解决方案 »

  1.   

    我的这种方法没用到splitContainer的
    public partial class Form2 : Form
        {        //Form3 f = new Form3();
            public Form2()
            {
                //InitializeComponent();
                InitializeComponent2();
            }        private void InitializeComponent2()
            {
                Panel panel1 = new System.Windows.Forms.Panel();            // 
                // panel1
                // 
                panel1.Dock = System.Windows.Forms.DockStyle.Left;
                panel1.Location = new System.Drawing.Point(0, 0);
                panel1.Name = "panel1";
                panel1.Size = new System.Drawing.Size(117, 486);
                panel1.TabIndex = 1;
                // 
                // Form2
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(677, 486);
                this.Controls.Add(panel1);
                this.IsMdiContainer = true;
                this.Name = "Form2";
                this.Text = "Form2";
                this.Load += new System.EventHandler(this.Form2_Load);            this.ResumeLayout(false);
            }        private void Form2_Load(object sender, EventArgs e)
            {
                ShowMdiForm(new Form3());
            }        private void ShowMdiForm(Form form)
            {
                form.LocationChanged += new EventHandler(form_LocationChanged);
                form.MdiParent = this;
                form.Show();
            }        public void form_LocationChanged(object sender, EventArgs e)
            {
                Form f = sender as Form;
                if (f.Location.X < 0)
                    f.Location = new Point(0, f.Location.Y);
            }
      

  2.   

    三楼的jishengzu谢了哈!
    大虾们还有别的方法吗?