Solved

Picture Box to be same size on the screen across multiple resolutions

Posted on 2013-11-06
2
564 Views
Last Modified: 2013-11-06
I have a picture box on a 1024 x 768 screen that measures 8.5 x 11 inches.  I would like for it to have the same dimensions on a higher resolution screen. Any suggestions experts?  Tks in advance.
0
Comment
Question by:GCCal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 36

Accepted Solution

by:
Kimputer earned 500 total points
ID: 39628904
Please note you cannot fix the "real" size of a picture box on any screen. After all, you don't know if the screen is 21", 23" or even 27", as all these screens probably have 1920 x 1080 resolution. You can imagine, if your code works on a 21" screen, with code for 1920 x 1080 resolution, on the 27" screen it's actually bigger. And VB.net (or any other programming code) actually cannot tell how much inch a screen is.
0
 

Author Comment

by:GCCal
ID: 39629050
Kimputer.............many thanks for your response.  Makes sense.

I worked around it a bit by using this code when the application starts:

        Dim GetWidth = Screen.PrimaryScreen.WorkingArea.Width
        Dim GetHeight = Screen.PrimaryScreen.WorkingArea.Height
        picCanvas.Width = picCanvas.Width * (GetWidth / 1024)
        picCanvas.Height = picCanvas.Height * (GetHeight / 768)

It is not perfect, but it gets the dimensions close enough for me

Thanks again.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question