Solved

Labels overlap text fields in Windows Form

Posted on 2013-05-29
9
852 Views
Last Modified: 2013-07-01
I have a windows form size set to 1024, 78.  I have a few users, that when they open this form, the labels overlap the text fields.  This user has a screen resolution of 1920 x 1080.  The view icon setting is at medium.  I have the code below in the form but nothing changed.  I have attached a picture of what is happening.  Any suggestions?

Dim rect As Rectangle = My.Computer.Screen.Bounds
        If rect.Width < 1024 OrElse rect.Height < 768 Then

            ' Put the form in the upper left corner
            Me.Location = New Point(0, 0)
            Dim widthRatio As Double = rect.Width / 1024

            ' Get the ratio of screen height : form's original height
            Dim heightRatio As Double = rect.Height / 768
            ' Determine which ratio is smaller, and use the dimension
            ' with the smaller ratio to calculate the dimension with the
            ' larger ratio.  This ensures that the dimension with the
            ' smaller ratio will not exceed the bounds of the screen.
            If widthRatio < heightRatio Then
                ' Width ratio is smaller, so set the form to take up the
                ' entire width of the screen, and set height based on
                ' desired 4:3 aspect ratio.
                Me.Width = rect.Width
                Me.Height = CInt(Me.Width * 3 / 4)
            Else
                ' Height ratio is smaller, so set the form to take up the
                ' entire height of the screen, and set width based on
                ' desired 4:3 aspect ratio.
                Me.Height = rect.Height
                Me.Width = CInt(Me.Height * 4 / 3)
            End If
        End If
finselect.jpg
0
Comment
Question by:Karen Wilson
  • 6
  • 2
9 Comments
 
LVL 16

Expert Comment

by:Brian Pringle
ID: 39205271
The user probably changed the font size in Windows to a larger size.  You could either have them change it back or hard-code your app's labels to be a specific font size.
0
 

Author Comment

by:Karen Wilson
ID: 39205340
It appears that they have the display set to medium 125%.  I will try to hard-code the labels and see what happens.
0
 

Author Comment

by:Karen Wilson
ID: 39205352
I checked my form and I already have the font set at Arial 8 for all my labels.  Can I change their computer display to the smaller default size?
0
 
LVL 40
ID: 39208259
You should not change their computer display. If they set it to 125%, it is because this is how they want to work and you can give them headaches if you start playing with that setting. On my Windows 8 tablet for instance, I have to leave the setting à 125% otherwise the desktop interface is useless.

You can try to play with different settings with the AutoScale mode of the form. This has worked for me in my last application.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:Karen Wilson
ID: 39208275
I changed the autoscale mode to font and it remained the same for this user.  I'll keep changing it to see if I can get one to work.
0
 
LVL 40
ID: 39208321
You might also have an option saved in the users configuration, and loop through the controls on the form to set their Font at 6.5 or 6.75. With the 125% increase, they will come close to 8.
0
 

Author Comment

by:Karen Wilson
ID: 39277787
Sorry it took me so long to come back to this.  I got sent off to another project.  Changing the font to 6 on the labels didn't work either.  Anyone else have any suggestions?
0
 

Accepted Solution

by:
Karen Wilson earned 0 total points
ID: 39277885
It's fixed!!
AutoScaleMode to DPI
AutoSize to True
AutoSizeMode to GrowAndShrink

Thanks to all that input.
0
 

Author Closing Comment

by:Karen Wilson
ID: 39289364
I searched the internet and found the AutoScale to DPI.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now