Click here to Skip to main content
15,354,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to show child window center of parent window ?
IpsitaMishra 4-Jan-13 5:04am
can you please specify your requirement so that every one can help you :) :)
Rockstar_ 4-Jan-13 5:07am
Do you know about MDI?
if you know make ur parent window to MDI...

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 ="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");
use this code

frmChildForm form = new frmChildForm();
form.MdiParent = this;
form.StartPosition = FormStartPosition.CenterParent;
NABIN SEN 4-Jan-13 5:28am
i have tried this but not worked......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900