显示父窗口的ChildWindow中心 [英] Show ChildWindow center of Parent Window
本文介绍了显示父窗口的ChildWindow中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何显示父窗口的子窗口中心?
How to show child window center of parent window ?
推荐答案
WPF:中心子窗口 [ ^ ]
试试这段代码。
try this code.
function MyPopUpWin() {
var iMyWidth;
var iMyHeight;
//half the screen width minus half the new window width (plus 5 pixel borders).
iMyWidth = (window.screen.width/2) - (75 + 10);
//half the screen height minus half the new window height (plus title and status bars).
iMyHeight = (window.screen.height/2) - (100 + 50);
//Open the window.
var win2 = window.open("filename.htm","Window2","status=no,height=200,width=150,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
win2.focus();
}
使用此代码
use this code
frmChildForm form = new frmChildForm();
form.MdiParent = this;
form.StartPosition = FormStartPosition.CenterParent;
form.Show()
;
这篇关于显示父窗口的ChildWindow中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文