例如:在form_parent中点击一按钮后,显示child窗体,如何让子窗体显示在主窗体的正中
Form_child child= new Form_child();
child.ShowDialog();

解决方案 »

  1.   


    Form_child child= new Form_child(); 
    child.StartPosition = FormStartPosition.CenterParent;
    child.ShowDialog();
      

  2.   

    把StartPosition属性设置成CenterParent就可以了
      

  3.   

    StartPosition = FormStartPosition.CenterParent
      

  4.   

    根据父窗体的Location确定子窗体的Location位置就行了。
      

  5.   

    startposition属性设为 Centerparent
      

  6.   

    child.StartPosition = FormStartPosition.CenterParent;