Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the Width and Height of Main form at runtime

Status
Not open for further replies.

walkesh

Programmer
Mar 31, 2009
9
US
Is it possible to change the width and height of an application's main form at run time? I have an application where when a certain option is selected, I want to make the main form smaller (in height and width) and once that mode is completed, restore to its original size. I have tried to set the height and width through the code with frmMain.Height and frmMain.Width, but the form is not changing its size.

Any help would be appreciated.
 
For starters, it won't if you have set constraints on width and height, set AutoSize to true, or set BorderStyle to some specific styles (can't remember the ones that don't allow resizing just now).

HTH
TonHu
 
Tonhu is right, but otherwise working in the way you described above should be just fine.

[bobafett] BobbaFet [bobafett]
Code:
if not Programming = 'Severe Migraine' then
                       ShowMessage('Eureka!');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top