An object-oriented programming language developed by Microsoft that can be used in .NET.
Follow-up:
User had scaling set to 300%. SMH :)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I developed an app that first checks the user's screen size on startup to see if it's big enough.
A user with a 4K monitor says he's being told his screen isn't big enough. He must run at a LOWER rez to get the program to run.
My detection code:
Dim intWorkingWidth As Integer = Screen.PrimaryScreen.WorkingArea.Width
If intWorkingWidth < 1366 Then
MsgBox("This program requires a minimum resolution of 1366x768.", MsgBoxStyle.Information, "Resolution Alert")
End
End If
I tested the app at 4K on my own computer and have no problem. Why might his "WorkingArea" be reporting as < 1366? Is there a better way to check screen size?
TIA
An object-oriented programming language developed by Microsoft that can be used in .NET.
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Follow-up:
User had scaling set to 300%. SMH :)
To get the right resolution even if DPI changes, you can add a Manifest file, with :
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
</windowsSettings>
</application>
or use the method from MSDN :
If the monitor is 4K it is hard to believe that the width is less than 1366.
This might help figure it out. (fwiw - I did notice when looking at my 4K monitor that clicking the resolution dropdown placed 1366 x 768 under the cursor)
Dim intWorkingWidth As Integer = Screen.PrimaryScreen.WorkingArea.Width
If intWorkingWidth < 1366 Then 'what happens if you change the check to <=
Dim s As String
s = String.Format("This program requires a minimum resolution of 1366 × 768. Your monitor W: {0} × H: {1}",
Screen.PrimaryScreen.WorkingArea.Width,
Screen.PrimaryScreen.WorkingArea.Height)
MessageBox.Show(s, "Resolution Alert", MessageBoxButtons.OK, MessageBoxIcon.Information)
'don't use End
End If