In the form page opened with ShowModalDialog or ShowModelessDialog, you want to dynamically change the size of the form, use the following JS scripts:
Dialogwidth = '400px'; dialogheight = '400px';