Page 1 of 1

showModalDialog - window size

Posted: Wed Sep 13, 2006 8:51 am
by Moriarty
Hi. Its the first time Ive used the showModalDialog function and was wondering how best to size the dialog to compensate for the window borders.

My command looks a bit like this:

Code: Select all

onclick='window.showModalDialog("BigBadForm.htm","Arg1","dialogHeight: 500px; dialogWidth: 700px; dialogTop: 150px; dialogLeft: 150px; edge: Raised; center: No; help: No; scroll: No; status: Yes;")'
While I set the width and height to 700 and 500 respectively, the internal size of the window.document object comes out to be 694 and 448.

Any help would be appreciated.

Thanks,
Moriarty

Posted: Wed Sep 13, 2006 1:48 pm
by feyd
Create the window at whatever size you want, check the internal width once the page renders and adjust the window to compensate.

Posted: Thu Sep 14, 2006 4:24 am
by Moriarty
Thanks, Feyd, but this only works with non-modal dialog boxes (as I understand it).

I've tried doing the auto-resize thing and whilst it works with window.open(ed) screens, it won't behave with showmodaldialog(ed) windows.

Thanks for taking the time, though.