-
Jan 25th, 2021, 03:48 AM
#1
Thread Starter
Junior Member
VB NET Scaling
If I write an application that has labels with font 12 pt Tahoma in screen resolution 1366x768.
Usually the size became bigger with low resolution and became smaller with high resolution.
What I want is users with screen resolution 1920x1080 will be able to read those labels with same size that I read in my screen.
Do VB.NET capable to do scaling?
Or we must add code by ourself?
Thank you.
-
Jan 26th, 2021, 11:27 AM
#2
Re: VB NET Scaling
Hello Weillee,
Here is a tutorial about printing in vb.net https://www.codeproject.com/Articles...rinting-in-NET
yours,
Peter Swinkels
-
Jan 26th, 2021, 08:46 PM
#3
Thread Starter
Junior Member
Re: VB NET Scaling
Originally Posted by Peter Swinkels
Hello Peter, thank you for your reply.
What I meant is the size of controls such as labels, buttons, datagrid, etc.
Is it possible for VB.NET for auto adjust the controls' size according to system resolution?
I've googled some say controls in VB.NET has property AutoScale, but I cannot find it.
-
Jan 26th, 2021, 09:12 PM
#4
Re: VB NET Scaling
If you use wpf forms instead of winforms, then you can have auto control layouts so the controls scale to fit the space.
May not be exactly what you want, but you have more options with wpf forms in the areas of control layout and presentation capability/flexibility.
"Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930
-
Jan 26th, 2021, 09:22 PM
#5
Thread Starter
Junior Member
Re: VB NET Scaling
Ok, passel.
Actually I never use wpf forms, but I'll check this out.
Thank you for this information.
-
Jan 27th, 2021, 03:21 AM
#6
Re: VB NET Scaling
Originally Posted by weilee
Hello Peter, thank you for your reply.
What I meant is the size of controls such as labels, buttons, datagrid, etc.
Is it possible for VB.NET for auto adjust the controls' size according to system resolution?
I've googled some say controls in VB.NET has property AutoScale, but I cannot find it.
Duh, somehow I thought you were asking about printing stuff on labels. My mistake. I am afraid I can't help you with your question sorry.
-
Jan 27th, 2021, 11:03 AM
#7
Lively Member
Re: VB NET Scaling
Here's something on automatic scaling for WinForms. Also read the part about high DPI support.
WinForm support for high DPI is a mixed bag at best. I've updated a number of older applications to work properly on higher resolution displays where rewriting them to use WPF wasn't practical. The main things to do is to switch the AutoScaleMode property to DPI and leave the form Font property at the default Microsoft Sans Serif 8.25pt. You will have to adjust the Font property on each label and control individually instead of letting inherit it from the form.
It's not perfect but it's a good compromise and made the applications useable on newer 2K and 4K displays.
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
|