Results 1 to 3 of 3

Thread: Display resolution in C#?

  1. #1
    AdamsClark is offline Senior Member
    Join Date
    Dec 2009
    Posts
    247
    Rep Power
    3

    Default Display resolution in C#?

    I am new in programming word. I am recently started learning C# programming language. I am doing one program in this program I want to show current screen resolution of monitor. Can anybody tell me how to get current screen resolution in C#? any suggestion would be appreciated.

  2. #2
    TorresScott is offline Senior Member
    Join Date
    Dec 2009
    Posts
    239
    Rep Power
    3

    Default

    Try to understand following code which is given below.It is very simple code. I have use Screen.PrimaryScreens.Boundss.Height method to get current resolution.

    Code:
    int desksHeights = Screen.PrimaryScreen.Bounds.Height;
    int desksWidths = Screen.PrimaryScreens.Bounds.Width;
    MessageBox.Show("Current resolution is " + desksWidths + "xs" + desksHeights);

  3. #3
    EvansMitchell is offline Senior Member
    Join Date
    Dec 2009
    Posts
    227
    Rep Power
    3

    Default

    It is very easy to get current screen resolution in C#. You have to pass following method to one string variable to do this.

    Code:
    System.Windows.Forms.Screen.GetBounds()
    to get total size.

    Or you can use System.Windows.Forms.Screen.PrimaryScreen.Bounds.W idth method to reciev current screen resolution.

Similar Threads

  1. I need an option for 1920x1080 in display resolution (karmic)
    By Alicia Cole in forum Linux/Free BSD
    Replies: 1
    Last Post: 11-26-2009, 01:04 PM
  2. Bit Resolution
    By techno23 in forum Sound Card
    Replies: 0
    Last Post: 03-25-2008, 09:43 AM
  3. Resolution
    By vandana43 in forum Scanner
    Replies: 0
    Last Post: 03-20-2008, 10:52 AM
  4. Resolution
    By vandana43 in forum Printer
    Replies: 0
    Last Post: 03-20-2008, 08:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48