如何在其他形式的中心打开一个表格

时间:2012-07-05 11:16:11

标签: c# wpf

标题中的问题,如何打开父母中心的表格

Window win = new MyWPFWindow();

win.... ???

1 个答案:

答案 0 :(得分:1)

Window win = new MyWPFWindow();
win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
// the "parent" needs to be another window; most likely, you can just use "this"
win.Owner = parent;
win.Show();