?
Solved

Labels overlap text fields in Windows Form

Posted on 2013-05-29
9
Medium Priority
?
1,036 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
[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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 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