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
  1. Home
  2. General Programming
  3. C#
  4. Window size to fit the screen resolution

Window size to fit the screen resolution

Scheduled Pinned Locked Moved C#
question
8 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.
  • L Offline
    L Offline
    lune12
    wrote on last edited by
    #1

    Hi, Is there a way to set the size of the form (in a Windows application) to the same size as the screen's resolution? Thanks.

    L P 2 Replies Last reply
    0
    • L lune12

      Hi, Is there a way to set the size of the form (in a Windows application) to the same size as the screen's resolution? Thanks.

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Like maximized?

      xacc.ide - now with TabsToSpaces support
      IronScheme - 1.0 alpha 4a out now (29 May 2008)

      L 1 Reply Last reply
      0
      • L lune12

        Hi, Is there a way to set the size of the form (in a Windows application) to the same size as the screen's resolution? Thanks.

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        You could always use the following code:

        Height = Screen.PrimaryScreen.Bounds.Height;
        Width = Screen.PrimaryScreen.Bounds.Width;

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        L 1 Reply Last reply
        0
        • L leppie

          Like maximized?

          xacc.ide - now with TabsToSpaces support
          IronScheme - 1.0 alpha 4a out now (29 May 2008)

          L Offline
          L Offline
          lune12
          wrote on last edited by
          #4

          Yes

          L 1 Reply Last reply
          0
          • P Pete OHanlon

            You could always use the following code:

            Height = Screen.PrimaryScreen.Bounds.Height;
            Width = Screen.PrimaryScreen.Bounds.Width;

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            L Offline
            L Offline
            lune12
            wrote on last edited by
            #5

            Thanks, This is a good answer but it doesn't substract the task bar size. Is there a possibility to perform like the maximize fuction?

            P 1 Reply Last reply
            0
            • L lune12

              Yes

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #6

              Form.WindowState

              xacc.ide - now with TabsToSpaces support
              IronScheme - 1.0 alpha 4a out now (29 May 2008)

              L 1 Reply Last reply
              0
              • L leppie

                Form.WindowState

                xacc.ide - now with TabsToSpaces support
                IronScheme - 1.0 alpha 4a out now (29 May 2008)

                L Offline
                L Offline
                lune12
                wrote on last edited by
                #7

                THANKS

                1 Reply Last reply
                0
                • L lune12

                  Thanks, This is a good answer but it doesn't substract the task bar size. Is there a possibility to perform like the maximize fuction?

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  Ahh - so you want it to look like it's maximized. If you want it to fill the screen, but don't want it to be maximized (i.e. you want to emulate the way office works) change Bounds to WorkingArea.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  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