Solved

How to get screen dimension in C# (winform)

Posted on 2004-09-14
3
2,814 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 125 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:Desp
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 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