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. Visual Basic
  4. Screen sizes

Screen sizes

Scheduled Pinned Locked Moved Visual Basic
question
12 Posts 5 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.
  • O offroaderdan

    Experts, I have an application which takes up the whole screen (15 inches) is there any way that if i take the app on to say a smaller screen can i get the program to find out the size and basically zoom out so the application fits nicely onto the screen? (Ihaven't yet tested the app on another screen yet but am guessing that it won't fit) Thus the same with a 17+ screen i would want the app to zoom in slightly. Can this be done or is there any surgestions? Many thanks Dan

    D Offline
    D Offline
    DaveAuld
    wrote on last edited by
    #2

    It is nothing to do with screen size in inches. It has all to do with the resolution e.g. 1024x768, 1280x1024, 2560x1600 etc.etc. In vb.net, you can obtain the current screen resolution from the My.Computer.Screen, it has various things under this depending on what exactly you want to know about the display properties. Also, if you using Anchoring and Docking of your controls in your form, when you resize the form, they will stay relative to each other in terms of size and positioning.

    Dave Don't forget to rate messages!
    Find Me On: Web|Facebook|Twitter|LinkedIn
    Waving? dave.m.auld[at]googlewave.com

    modified on Sunday, March 21, 2010 9:34 AM

    O 1 Reply Last reply
    0
    • D DaveAuld

      It is nothing to do with screen size in inches. It has all to do with the resolution e.g. 1024x768, 1280x1024, 2560x1600 etc.etc. In vb.net, you can obtain the current screen resolution from the My.Computer.Screen, it has various things under this depending on what exactly you want to know about the display properties. Also, if you using Anchoring and Docking of your controls in your form, when you resize the form, they will stay relative to each other in terms of size and positioning.

      Dave Don't forget to rate messages!
      Find Me On: Web|Facebook|Twitter|LinkedIn
      Waving? dave.m.auld[at]googlewave.com

      modified on Sunday, March 21, 2010 9:34 AM

      O Offline
      O Offline
      offroaderdan
      wrote on last edited by
      #3

      Is there any way that i can get the current screen size and alter it automatically, e.g the screen size i am currently working on is 1280 by 800 pixels. If for example someone uses this program has a reolution of 1024 by 768 pixels can i alter the screen size for my program and whe they exit the program the pixels are returned to what they were at the start?? How would i go about doing this?

      D D 2 Replies Last reply
      0
      • O offroaderdan

        Is there any way that i can get the current screen size and alter it automatically, e.g the screen size i am currently working on is 1280 by 800 pixels. If for example someone uses this program has a reolution of 1024 by 768 pixels can i alter the screen size for my program and whe they exit the program the pixels are returned to what they were at the start?? How would i go about doing this?

        D Offline
        D Offline
        Dalek Dave
        wrote on last edited by
        #4

        Try this...

        Public Function ScreenResolution() As String

        Dim iWidth as integer, iHeight as Integer

        iWidth = Screen.Width \ Screen.TwipsPerPixelX
        iHeight = Screen.Height \ Screen.TwipsPerPixelY
        ScreenResolution = iWidth & " X " & iHeight

        End Function

        or

        Public Function ScreenResolution() As String
        Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
        Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
        Return intX & " X " & intY
        End Function

        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

        D 1 Reply Last reply
        0
        • O offroaderdan

          Is there any way that i can get the current screen size and alter it automatically, e.g the screen size i am currently working on is 1280 by 800 pixels. If for example someone uses this program has a reolution of 1024 by 768 pixels can i alter the screen size for my program and whe they exit the program the pixels are returned to what they were at the start?? How would i go about doing this?

          D Offline
          D Offline
          DaveAuld
          wrote on last edited by
          #5

          Did you make a response and then edit it completely? My email notifications tell me so! Do not think about changing the users resolution to fit your application, that is bad practice, and you would soon alienate your user base. a) The users hardware may be restricted to a given resolution, e.g. on a laptop/netbook etc. b) The user may have disabilities that require them to use a particular resolution. So, don't think about it. Design you application at a 'general' resolution, and as i say use docking/anchoring to keep the layout proportional regardless of the true resolution.

          Dave Don't forget to rate messages!
          Find Me On: Web|Facebook|Twitter|LinkedIn
          Waving? dave.m.auld[at]googlewave.com

          O 1 Reply Last reply
          0
          • D DaveAuld

            Did you make a response and then edit it completely? My email notifications tell me so! Do not think about changing the users resolution to fit your application, that is bad practice, and you would soon alienate your user base. a) The users hardware may be restricted to a given resolution, e.g. on a laptop/netbook etc. b) The user may have disabilities that require them to use a particular resolution. So, don't think about it. Design you application at a 'general' resolution, and as i say use docking/anchoring to keep the layout proportional regardless of the true resolution.

            Dave Don't forget to rate messages!
            Find Me On: Web|Facebook|Twitter|LinkedIn
            Waving? dave.m.auld[at]googlewave.com

            O Offline
            O Offline
            offroaderdan
            wrote on last edited by
            #6

            daveauld wrote:

            Did you make a response and then edit it completely?

            Yes i think i did by accident. I was looking at this and posted a message through my phone. I then checked it out when i got home on my computer. I am now going to test the app on a bigger screen that i managed to borrow and think that what you said about the disabilites and hardware is a good point. I was just concerned that because my form in vb.net covers most of the 15 inch screen i didn't want it to look horrible on a 13 inch screen, thus the screen resolution option. Thanks for the suggestions and sorry for the email notification.

            D O 2 Replies Last reply
            0
            • O offroaderdan

              daveauld wrote:

              Did you make a response and then edit it completely?

              Yes i think i did by accident. I was looking at this and posted a message through my phone. I then checked it out when i got home on my computer. I am now going to test the app on a bigger screen that i managed to borrow and think that what you said about the disabilites and hardware is a good point. I was just concerned that because my form in vb.net covers most of the 15 inch screen i didn't want it to look horrible on a 13 inch screen, thus the screen resolution option. Thanks for the suggestions and sorry for the email notification.

              D Offline
              D Offline
              DaveAuld
              wrote on last edited by
              #7

              I find the problem the other way round. I design on my laptop (1920x1200) primarily and my home pc (2560x1600). As you can see these resolutions are are bigger than the average joe's. They look fine on these, but when i run them on things with smaller resolution, i always find they look terrible. Nobody said it would be easy! I tend to start at an 800x600 or 1024x768 window size, depending on what i am doing, and see how they look.

              Dave Don't forget to rate messages!
              Find Me On: Web|Facebook|Twitter|LinkedIn
              Waving? dave.m.auld[at]googlewave.com

              1 Reply Last reply
              0
              • O offroaderdan

                daveauld wrote:

                Did you make a response and then edit it completely?

                Yes i think i did by accident. I was looking at this and posted a message through my phone. I then checked it out when i got home on my computer. I am now going to test the app on a bigger screen that i managed to borrow and think that what you said about the disabilites and hardware is a good point. I was just concerned that because my form in vb.net covers most of the 15 inch screen i didn't want it to look horrible on a 13 inch screen, thus the screen resolution option. Thanks for the suggestions and sorry for the email notification.

                O Offline
                O Offline
                offroaderdan
                wrote on last edited by
                #8

                I just tried the program on the 17 inch and it has done what i thought it would and it is basically to far "zoomed in" I just tried to dock the items however it messes up the order i have them in. What is the best way to dock items?

                M 1 Reply Last reply
                0
                • D Dalek Dave

                  Try this...

                  Public Function ScreenResolution() As String

                  Dim iWidth as integer, iHeight as Integer

                  iWidth = Screen.Width \ Screen.TwipsPerPixelX
                  iHeight = Screen.Height \ Screen.TwipsPerPixelY
                  ScreenResolution = iWidth & " X " & iHeight

                  End Function

                  or

                  Public Function ScreenResolution() As String
                  Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
                  Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
                  Return intX & " X " & intY
                  End Function

                  ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                  D Offline
                  D Offline
                  Dalek Dave
                  wrote on last edited by
                  #9

                  Don't see why I deserved a 1 for that, it is just a way of determining the screen res. Useful if you are trying to implement on different monitors. Hey ho, can't please some people.

                  ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                  D 1 Reply Last reply
                  0
                  • O offroaderdan

                    I just tried the program on the 17 inch and it has done what i thought it would and it is basically to far "zoomed in" I just tried to dock the items however it messes up the order i have them in. What is the best way to dock items?

                    M Offline
                    M Offline
                    Mycroft Holmes
                    wrote on last edited by
                    #10

                    Getting a form to behave reasonably at different screen resolutions can be tricky, I use a combination of docked panels and anchored controls. Pick the control to dock as fill, usually a list control. You also need to be aware of the z order of the controls when docking (bring to front and send to back) as these will seriously screw with your layout. Design for the smallest reasonable screens resolution, don't force full screen, let the user do that.

                    Never underestimate the power of human stupidity RAH

                    1 Reply Last reply
                    0
                    • D Dalek Dave

                      Don't see why I deserved a 1 for that, it is just a way of determining the screen res. Useful if you are trying to implement on different monitors. Hey ho, can't please some people.

                      ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                      D Offline
                      D Offline
                      David Skelly
                      wrote on last edited by
                      #11

                      I'm guessing it's because you didn't answer the question that he asked. He didn't ask how to determine the screen size, he asked how to set the screen size.

                      D 1 Reply Last reply
                      0
                      • D David Skelly

                        I'm guessing it's because you didn't answer the question that he asked. He didn't ask how to determine the screen size, he asked how to set the screen size.

                        D Offline
                        D Offline
                        Dalek Dave
                        wrote on last edited by
                        #12

                        This is what happens when you try to help on a sunday afternoon with the footy on the telly. :) Still, he shouldn't try to set the resolution.

                        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                        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