Show a child form in the centre of Parent form in C#

后端 未结 19 1102
不思量自难忘°
不思量自难忘° 2020-11-28 08:21

I create a new form and call from the parent form as follows:

loginForm = new SubLogin();   
loginForm.Show();

I need to display the chi

19条回答
  •  一整个雨季
    2020-11-28 09:01

    When launching a form inside an MDIForm form you will need to use .CenterScreen instead of .CenterParent.

    FrmLogin f = new FrmLogin();
    f.MdiParent = this;
    f.StartPosition = FormStartPosition.CenterScreen;
    f.Show();
    

提交回复
热议问题