Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make the width of a windows form to 100% as in HTML

Tags:

c#

winforms

I have a windows form which client needs to appear full screen in any resolution(Needs to looks like a web page).But the problem is to make the form width to 100%.

Any suggestions?

like image 977
udaya726 Avatar asked Jan 25 '12 05:01

udaya726


1 Answers

If you only want to set the width to 100%:

this.Width = Screen.PrimaryScreen.Bounds.Width;

If you want set both width and height:

this.WindowState = FormWindowState.Maximized;
like image 73
Guilherme Ferreira Avatar answered Sep 27 '22 21:09

Guilherme Ferreira