Click here to Skip to main content
15,884,388 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 ?
Posted
Comments
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...

 
Share this answer
 
try this code.
JavaScript
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();
}
 
Share this answer
 
use this code

C#
frmChildForm form = new frmChildForm();
form.MdiParent = this;
form.StartPosition = FormStartPosition.CenterParent;
form.Show()
;
 
Share this answer
 
Comments
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