[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Labels overlap text fields in Windows Form

Posted on 2013-05-29
9
Medium Priority
?
1,112 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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
 

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

830 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