all groups > dotnet windows forms designtime > february 2007 >
You're in the

dotnet windows forms designtime

group:

Screen dimensions


Screen dimensions Lupo
2/26/2007 2:22:10 AM
dotnet windows forms designtime:
Hi!
I need to create a form and fill it with a number of button decided at
run-time..then I need to create this buttons according to their number such
that they adapt on the whole screen dimension..
Is there any property or anything that tells me this?
Thanx!!!
Re: Screen dimensions Bryan Phillips
3/14/2007 7:00:28 PM
Use this code which is tolerant of multiple monitors:

public class Form1 : Form
{
public Form1(){
this.Load += new EventHandler(Form1_Load);
}

public void Form1_Load(object sender, EventArgs e)
{
MessageBox.Show("The screen resolution is: " +
Screen.FromControl(this).Bounds);
}
}

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com



[quoted text, click to view]
AddThis Social Bookmark Button