-
Mar 5th, 2021, 04:43 PM
#1
Thread Starter
Hyperactive Member
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.
How? Under this post there is "RATE THIS POST" button. Click on it.
-
Mar 5th, 2021, 06:42 PM
#2
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.
-
Mar 5th, 2021, 07:32 PM
#3
New Member
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
-
Mar 5th, 2021, 08:46 PM
#4
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)
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 5th, 2021, 08:53 PM
#5
Re: Window2 is not in fullscreen mode even correct resolution is detected
This works...
Code:
Me.Bounds = Screen.PrimaryScreen.Bounds
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 5th, 2021, 10:12 PM
#6
New Member
Re: Window2 is not in fullscreen mode even correct resolution is detected
Why not
Code:
WindowState = FormWindowState.Maximized
-
Mar 5th, 2021, 11:06 PM
#7
Re: Window2 is not in fullscreen mode even correct resolution is detected
Originally Posted by kensen
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.
-
Mar 6th, 2021, 07:47 AM
#8
Thread Starter
Hyperactive Member
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.
How? Under this post there is "RATE THIS POST" button. Click on it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|