Discussion:
Screen dimensions
(too old to reply)
Lupo
2007-02-26 10:22:10 UTC
Permalink
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!!!
Davide
Bryan Phillips
2007-03-14 19:00:28 UTC
Permalink
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
Post by Lupo
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!!!
Davide
Loading...