Scale adjustment on Windows Forms in VB.Net - vb.net

Ok so i know this seems to have been asked a million times but!!!!!!
I have written an application in VB.NEt utilizing windows forms, my screen is set to 100% scaling and all works A OK!! Until a user runs the application on a PC where the scale is set at 125% or 150% and the windows form becomes too big for the screen and they can not access certain features of the form. The same applies if they have two monitors one set at a different scale to the other, if you drag it over the the high percentage screen the form becomes too big. This clearly has something to do with AutoScaleMode and DPI Aware but having tried all combinations the issue remains!!! :-( and ideas??
I have tried changing AutoScale Mode to DPI, Inherit, Font and None and i have trued changing DPI Aware to False in the Windows settings.

Related

Blur UI on High DPI windows system

wxWidgets 3.1 claims to fix the Windows High DPI issues. It works too but I see blur UI (fonts/bitmaps) looks stretched.
I went through the https://learn.microsoft.com/en-us/windows/desktop/hidpi/high-dpi-desktop-application-development-on-windows
I did the manifest changes to make my application DPI-aware, it removed the blur effect but application layout went wrong, every layout looks smaller (unusable UI).
Note* issue more vigilant on 3K and 4K system. Hardcoded pixel sizes are not scaling (like 400px width button, 500pixel width panel etc).
wxWidgets gives you a (relatively simple) way to make your application work in high DPI, but doesn't -- and can't -- do it automatically for you, in particular only sizer-based layouts without hardcoded pixel sizes will work correctly and you do need to provide your own higher definition artwork.
Concerning the existing pixel values, the simplest (even though not really the best) way to make them work better is to put FromDIP() calls around them.
Also note that you don't need to do anything special for pixel values in XRC, they're already interpreted as being resolution-independent pixels and are scaled according to the DPI automatically.

Prevent wxWidgets app from scaling sizes on higher dpi

I'm writing a wxWidgets (3.1.0) app that is supposed to work on windows and mac.
On windows when i set the scaling of the text to more than 100% the sizes of my controls get all messed up. I have a dpi manifest that says my app is dpi aware. I also set the font pixel size on my dialogs and that works to some extent. When i set the size of some element from code it is resized to that pixel size which is what i need, but any size that is set in the xrc file gets scaled up. Also when i try to reduce the size of any wxSpinCtrl it can be reduced normally to some point but then only the text box gets smaller and the buttons remain unproportionally large. So is there a way to tell my app not to scale any sizes and just let everything be exactly the same pixel size as it would be on a normal dpi (despite the fact that my app will look small on higher resolutions)?
There is no way to prevent the proper scaling from being applied using wxWidgets API and I don't think this is going to change because it just doesn't seem to make any sense.
However rebuilding wxWidgets with wxHAVE_DPI_INDEPENDENT_PIXELS defined should trick the library into thinking that the underlying graphical toolkit already scales the pixel values and so prevent it from doing it on its own. I've never tested this but, AFAICS, this should result in what you want.
Nevertheless let me reiterate that what you want is totally wrong and the real fix for this problem is to explain it to whoever decided to do it.

xaml minimum application screen size

how can I set a minimum size in an universal app (win 10) for the application window? in my project I have only object with Page tag, not Window. I want that the screen of the application can't be resized less off a certein value.
thanks a lot
In the Package.appxmanifest of a Windows 8.1 Universal app, you could set a minimum width, to one of 3 pre-defined values. Setting minimum values on your page will not prevent your application from resizing. Setting maximum values will not prevent resizing either, but it will result in black borders when the application frame is larger than your set dimension. It's worth mentioning that 320 px is the absolute minimum width on 8.1 and on Windows 10 (for phones).
In Windows 10 UWP this property is no longer available. You should AdaptiveTriggers to handle your UI layout on Windows 10.
If you want to check the minimum resize dimensions, keep the scaling of your pc in mind. My laptop scales at 125%, a screenshot of the minimum dimension for the desktop client is 627x441 (~500x350 at 100%) including the space used for the app bar. But it's more common to just use AdaptiveTrigger and 720 pixels as the cut-off between phone and tablet.
you are working on a universal app, you shouldn't set a minimum width . It should be working on every resolution and device.
you should instead use visual state manager and adaptive triggers.
best of luck !

Ignore larger font size

I'm not sure if this is a Windows feature or it is a part of the video driver, but when you change screen resolutions you have the option of making the font size 125% or 150% of normal. This causes me endless headaches when designing forms because one woman in the office has her's set to 125%. Before I publish I must set my development machine to match her resolution to make sure everything is visible. This means logging off and on.
Is there a way to have VB.Net ignore that so it does not increase the font size and stretch controls to accommodate? I've noticed that it does not appear all programs increase font size.
Greg

Screen resolution issue

I have written an application. It works fine on some resolutions but most of the controls are over lapped when it is run on some other computers.
Is there any way of setting the application automatically when it is run on different computers?
Thanks
Furqan
You might want to take a look at this: http://msdn.microsoft.com/en-us/library/ms229649.aspx
(assuming this is not WPF)
You can do a lot with docking and anchoring to help your form maintain it's usability at different sizes. But, there are practical limits. You can enforce a minimum size and ensure that your controls resize appropriately down to that limit.