Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to get screen dimension in C# (winform)

Posted on 2004-09-14
3
Medium Priority
?
2,846 Views
Last Modified: 2008-02-07
Hi all,

I'm a newbie and want to know how to get screen dimesion in C# (Winform). It will help me to calculate where to put my control by percent to window screen (not form size)

Any suggestion?
0
Comment
Question by:dungla
3 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 375 total points
ID: 12061336
Form. DeskTop bounds is a property that gets or sets the form bounds

Eg: Here is a sample implementation

public void MoveMyForm()
 {
    // Create a Rectangle object that will be used as the bound of the form.
    Rectangle tempRect = new Rectangle(50,50,100,100);
    //  Set the bounds of the form using the Rectangle object.
    this.DesktopBounds = tempRect;
 }
0
 
LVL 19

Expert Comment

by:Fahad Mukhtar
ID: 12061720
Check these values:

SystemInformation.PrimaryMonitorSize
SystemInformation.WorkingArea
SystemInformation.VirtualScreen
Screen.PrimaryScreen.Bounds
Screen.PrimaryScreen.WorkingArea
0
 
LVL 8

Expert Comment

by:vinhnl
ID: 12095493
System.Windows.Forms.SystemInformation (no for points)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question