因为不是mdi父子级的子窗体,要怎么做???

解决方案 »

  1.   

    我是c#初学者,所以用了初学者的方法,大家勿笑~~       private void button1_Click(object sender, EventArgs e)
            {
                Form2 frm2 = new Form2();
                Form3 frm3 = new Form3();
                frm2.StartPosition = FormStartPosition.Manual;
                frm3.StartPosition = FormStartPosition.Manual;
                frm2.Left = (Screen.AllScreens[0].Bounds.Width - (frm2.Width + frm3.Width)) / 2;//设置第一个窗体距离屏幕左边的距离
                frm3.Left = (Screen.AllScreens[0].Bounds.Width - (frm2.Width + frm3.Width)) / 2 + frm2.Height;//设置第二个窗体距离屏幕左边的距离;
                frm2.Show();
                frm3.Show();
            }
      

  2.   

    在两个窗体的load事件中 确定它们的位置就好了
      

  3.   

    发现窗体的位置只能通过StartPosition属性设置,而这个属性只提供了5种位置选项,很不够!今天在网上找到了一个解决的方法,如下:int x= System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width/2;
    int y=System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height /2;
    this.SetDesktopLocation(x,y);注释:
    System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width;   //当前显示器的宽度
    System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Height; //当前显示器的高度
    this.SetDesktopLocation(x,y); //设置窗体打开后在显示器上的坐标本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/hejialin666/archive/2010/01/28/5266372.aspx