Results 1 to 8 of 8

Thread: Window2 is not in fullscreen mode even correct resolution is detected

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2018
    Posts
    230

    Window2 is not in fullscreen mode even correct resolution is detected

    Hello,
    I am facing problem - window2 is not in fullscreen mode (I can see approx 30 cm from the top of monitor and also start menu is visible) even though correct resolution is detected (I saw correct values in textboxes from testing).
    Code:
    Private Sub Window2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
            Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
            Me.Width = intX
            Me.Height = intY
        End Sub
    I cannot use the window_state.maximize because then I cannot see other important window.
    Please dont forget to add good reputation if my advices were useful for you.

  2. #2
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Skunthorpe, North Lincolnshire, England.
    Posts
    2,099

    Re: Window2 is not in fullscreen mode even correct resolution is detected

    Hi,

    What is 'Window2' ?

    Have you re-named a Form, Form2 for example ?

    You say you can see approximately 30cm from the top of the monitor... This doesn't help since we don't know the size of your monitor.
    You also say 'I cannot use the window_state.maximize because then I cannot see other important window.', if your 'Window2' were to be as you would expect from your code, surly you would still not be able to 'see other important window.'.

    To obtain the primary screen size I would actually use: -
    Code:
            Dim intX As Integer = My.Computer.Screen.Bounds.Size.Width
            Dim intY As Integer = My.Computer.Screen.Bounds.Size.Height
    But I suspect that the result would be the same.
    You seem to imply that your 'Window2' is not your Form1, in which case using 'Me.Width' (etc) would only affect your Form1. (Or whichever form you are in).
    Surly if it's another form then it's that form's width and height you ought to be setting.


    Poppa
    Along with the sunshine there has to be a little rain sometime.

  3. #3
    New Member
    Join Date
    Oct 2020
    Location
    Europe
    Posts
    9

    Re: Window2 is not in fullscreen mode even correct resolution is detected

    Don't understand exactly..
    Is maybe your system resolution set to other than 100% ?

    On my Notebook I have a screen resolution of 1920 x 1080 and the system scaling is set to 125 %
    With:

    Code:
    Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
    Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
    I get intX=1536 and intY=864

    In this case getting the scale-factor could help

    https://www.vbforums.com/showthread....ale-and-Layout

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    24,178

    Re: Window2 is not in fullscreen mode even correct resolution is detected

    Try this...

    Code:
    Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
    Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
    Me.SetBounds(0, 0, intX, intY)

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    24,178

    Re: Window2 is not in fullscreen mode even correct resolution is detected

    This works...

    Code:
    Me.Bounds = Screen.PrimaryScreen.Bounds

  6. #6
    New Member
    Join Date
    Oct 2020
    Location
    Europe
    Posts
    9

    Re: Window2 is not in fullscreen mode even correct resolution is detected

    Why not

    Code:
    WindowState = FormWindowState.Maximized

  7. #7
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,429

    Re: Window2 is not in fullscreen mode even correct resolution is detected

    Quote Originally Posted by kensen View Post
    Why not

    Code:
    WindowState = FormWindowState.Maximized
    If only that had been explicitly answered in the first post. That said, I don't see how the reason provided is valid, because maximising a form or resizing it to fill the screen will have exactly the same effect as far as covering other windows or not.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Oct 2018
    Posts
    230

    Re: Window2 is not in fullscreen mode even correct resolution is detected

    kensen,
    no, my resolution is 1366x768 (maximal and what I am currently using) and scale is set to 100%

    paul,
    Code:
    Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width
    Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height
    Me.SetBounds(0, 0, intX, intY)
    TextBox1.Text = intX
    TextBox2.Text = intY
    using this code desktop and taskbar are covered, but external window doesnt popup, so I tried similar code in order to get resolution of 1365x767 pixels:

    Code:
    Dim intX As Integer = Screen.PrimaryScreen.Bounds.Width - 1
    Dim intY As Integer = Screen.PrimaryScreen.Bounds.Height - 1
    Me.SetBounds(0, 0, intX, intY)
    TextBox1.Text = intX
    TextBox2.Text = intY
    window popups and desktop is covered, but taskbar is left uncovered

    Code:
    Me.Bounds = Screen.PrimaryScreen.Bounds
    This does not work - same situation as code1 in this post
    Please dont forget to add good reputation if my advices were useful for you.

Posting Permissions

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



Click Here to Expand Forum to Full Width