Results 1 to 7 of 7

Thread: VB NET Scaling

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    18

    Question 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.

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    18

    Re: VB NET Scaling

    Quote Originally Posted by Peter Swinkels View Post
    Hello Weillee,

    Here is a tutorial about printing in vb.net https://www.codeproject.com/Articles...rinting-in-NET

    yours,
    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.

  4. #4
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    18

    Re: VB NET Scaling

    Ok, passel.
    Actually I never use wpf forms, but I'll check this out.
    Thank you for this information.

  6. #6
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: VB NET Scaling

    Quote Originally Posted by weilee View Post
    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.

  7. #7
    Lively Member Grant Swinger's Avatar
    Join Date
    Jul 2015
    Posts
    71

    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
  •  



Click Here to Expand Forum to Full Width