Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5928697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:19:21+00:00 2026-05-22T14:19:21+00:00

I need to find out if the user’s screen is set to normal 96

  • 0

I need to find out if the user’s screen is set to normal 96 dpi (small size), large 120 dpi fonts, or something else. How do I do that in VB.NET (preferred) or C#?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:19:21+00:00Added an answer on May 22, 2026 at 2:19 pm

    The best way is just to let the form resize itself automatically, based on the user’s current DPI settings. To make it do that, just set the AutoScaleMode property to AutoScaleMode.Dpi and enable the AutoSize property. You can do this either from the Properties Window in the designer or though code:

    Public Sub New()
        InitializeComponent()
    
        Me.AutoScaleMode = AutoScaleMode.Dpi
        Me.AutoSize = True
    End Sub
    

    Or, if you need to know this information while drawing (such as in the Paint event handler method), you can extract the information from the DpiX and DpiY properties of the Graphics class instance.

    Private Sub myControl_Paint(ByVal sender As Object, ByVal e As PaintEventArgs)
        Dim dpiX As Single = e.Graphics.DpiX
        Dim dpiY As Single = e.Graphics.DpiY
    
        ' Do your drawing here
        ' ...
    End Sub
    

    Finally, if you need to determine the DPI level on-the-fly, you will have to create a temporary instance of the Graphics class for your form, and check the DpiX and DpiY properties, as shown above. The CreateGraphics method of the form class makes this very easy to do; just ensure that you wrap the creation of this object in a Using statement to avoid memory leaks. Sample code:

    Dim dpiX As Single
    Dim dpiY As Single
    
    Using g As Graphics = myForm.CreateGraphics()
        dpiX = g.DpiX
        dpiY = g.DpiY
    End Using
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find out the word in an image where user has clicked.
I need to find out the user who has posted the most number of
I need to find out if a specific user belongs to a particular group
I need to find out if two dates the user selects are the same
I need to find out if a connection limit has been set on a
I need to find out quota details for the current user, I`ve tried exec(quota
I need to find out all AD groups SIDs that current user belongs to
I need some way to find out when the user released the mouse button
I have following table in hive user-id, user-name, user-address,clicks,impressions,page-id,page-name I need to find out
I need to find out how to format numbers as strings. My code is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.