Dimensions in fullscreen mode

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sundayCoder
    New Member
    • Mar 2014
    • 10

    Dimensions in fullscreen mode

    Hello!

    My monitor's resolution is 1600 x 900 pixels.

    I've made full screenmode like this:

    Code:
    Me.WindowState = FormWindowState.Maximized
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    If I then get the dimensions of screen's working area like this...

    Code:
    Dim screenWorkingArea As Rectangle
    screenWorkingArea = SystemInformation.WorkingArea
    ...debug.print shows that the width of the screenWorkingAr ea is 1600, but the height of the screenWorkingAr ea is 870 -- not 900. Why? What should I do in order to get the height of screenWorkingAr ea as 900?

    I use Visual Basic 2008 Express Edition.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Sounds right to me. The start menu is probably taking some of the vertical. Or the very top bar of the window with the minimize, maximize, and close buttons is probably taking some of the vertical as well.

    Comment

    • sundayCoder
      New Member
      • Mar 2014
      • 10

      #3
      Thanks! As far as I can see these 900-870 pixels are the height of the start menu.

      I guess there isn't any real way the make fullscreen mode in Visual Basic.

      The height of the start menu can vary on different systems. Is there any way to determine the height of the start menu in Visual Basic?

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Not sure why you would need to know the height of the start menu. But if you take the screen resolution and subtract the working space resolution, what's left should be the start menu bar.

        Comment

        • sundayCoder
          New Member
          • Mar 2014
          • 10

          #5
          I have still one question regarding the dimensions of this full screenmode.

          In my system the height of the screen is 900 pixels. If I place a PictureBox that's height is 900 pixels at (x,0), it seems that y-position 0 is above the visible area: There seems to be 8 pixels of empty space at the bottom of the screen.

          If the location of the PictureBox is (x,8) the whole picture is shown, the picture fills the whole visible vertical area.

          What should I do in order to place the picture at position (x,0) so that the whole picture that's height is 900 pixels fills the whole vertical area? Is the origin different than (0,0)?

          I have tested that the height of the PictureBox is 900 pixels and the height of the image in the PictureBox is 900 pixels.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            That I don't know. I don't work much in VB6 but we do have other experts on this site that do. Hopefully one of them will be able to answer your question.

            Comment

            • sundayCoder
              New Member
              • Mar 2014
              • 10

              #7
              I tested that...
              Code:
              Debug.Print(Me.Top)
              ...gives -8.

              If I put a line...
              Code:
              Me.Top = 0
              ...Debug.Print still gives -8.

              I think this is the problem I described above. Can anyone give any help?

              Comment

              • sundayCoder
                New Member
                • Mar 2014
                • 10

                #8
                This is my own poor man solution to my question.

                The picture in my program is shown in PictureBox1.

                I have these code lines to set the location of PictureBox1:
                Code:
                Dim picBox1loc As Point
                picBox1loc.X = (screenBounds.Width - newWidth) / 2
                picBox1loc.Y = (screenBounds.Height - newHeight) / 2
                Me.PictureBox1.Location = picBox1loc
                And the screenBounds are determined like this:
                Code:
                screenBounds = My.Computer.Screen.Bounds
                (The newWidth and newHeight are scaled dimensions for the fullscreen mode)

                The above lines for picBox1loc center the picture in the fullscreen mode.

                But as I earlier noticed Me.Top is -8.

                I have added these lines to my code:
                Code:
                If Me.Top < 0 Then
                picBox1loc.Y = picBox1loc.Y + (-(Me.Top))
                End If
                This gives a poor man solution to problem I have described. Anyone has any better?

                Comment

                Working...