Screen Position ?

W

WJ

In c# Windows Form, there are 2 properties: Top and Left. How do I get the
Height & Width that match with those of the screen at run time ? I donot
want to do "Maximize" to cover the whole screen.

Thanks

John
 
J

Jon Skeet [C# MVP]

WJ said:
In c# Windows Form, there are 2 properties: Top and Left. How do I get the
Height & Width that match with those of the screen at run time ? I donot
want to do "Maximize" to cover the whole screen.

Use Screen.FromControl to get the relevant Screen, and then
Screen.Bounds to get its bounds.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top