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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resizing a form to fit resolution

Status
Not open for further replies.

dandot

Programmer
Jul 19, 2005
53
0
0
CA
Hi All....

Is there any property that fits a form to size of the resolution and adjusts the contents accordingly?

My apologies if this has been answered before... hte search function is down due to maintenance :(.
 
The form has a WindowState property which you can set to Maximize.

Then you can use the Dock and Anchor features of controls on the form to allow their sizes and locations to adjust accordingly.

Keep in mind that when you add controls that are docked - the order in which you add the controls makes a difference to how they are displayed.

I recommend finding a Tutorial on C# Forms and Docking/Anchoring
 
How does that work with MDI applications though? I have a child form that I set to Maximize and it doesn't resize to fit the screen.

 
Actually I think I figured it out for myself. This worked for me. The mistake I made was to configure the settings within the child form. You need to configure the maximized when loading the child form from the parent.

Code:
 reportForm = new frmAllScannedData();
            reportForm.MdiParent = this;
            reportForm.WindowState = FormWindowState.Maximized;
            reportForm.Show();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top