Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Getting screen width and height

Getting screen width and height

Scheduled Pinned Locked Moved Managed C++/CLI
questionc++
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    m_mun
    wrote on last edited by
    #1

    Hi How can i get the screen width and height in Managed C++/CLI? I have used

    Screen^ screen = gcnew Screen::PrimaryScreen;

    But its not working. Thanks

    L A 2 Replies Last reply
    0
    • M m_mun

      Hi How can i get the screen width and height in Managed C++/CLI? I have used

      Screen^ screen = gcnew Screen::PrimaryScreen;

      But its not working. Thanks

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Within the Screen class, PrimaryScreen is a property, not a constructor. So you don't need gcnew FYI1: "its not working" is not informative; if there is an error or exception, best is to show us the message. FYI2: all this is explained in the documentation. Maybe it would be wise to study an introductory book when getting acquainted to a new technology or language. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      Happy New Year to all.
      We hope 2010 soon brings us automatic PRE tags!
      Until then, please insert them manually.


      1 Reply Last reply
      0
      • M m_mun

        Hi How can i get the screen width and height in Managed C++/CLI? I have used

        Screen^ screen = gcnew Screen::PrimaryScreen;

        But its not working. Thanks

        A Offline
        A Offline
        Andreoli Carlo
        wrote on last edited by
        #3

        Easy at it's: int monitor_height=Screen::PrimaryScreen->Bounds.Height; int monitor_width=Screen::PrimaryScreen->Bounds.Width;

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups