Solved

How to get screen dimension in C# (winform)

Posted on 2004-09-14
3
2,804 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
Comment Utility
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
Comment Utility
Check these values:

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

Expert Comment

by:vinhnl
Comment Utility
System.Windows.Forms.SystemInformation (no for points)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now