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 6617951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:45:56+00:00 2026-05-25T20:45:56+00:00

I have some custom user controls in my .net winforms program that do not

  • 0

I have some custom user controls in my .net winforms program that do not display correctly when the user has selected larger text size. This setting:
enter image description here

My controls look like this,

enter image description here

Instead of like this,

enter image description here

The bill to area and ship to area are both custom controls. I don’t know if this is contributing to the problem but I do have code in each to help scale the phone/fax areas to stretch nicely, like this code from the bill to control,

    Private Sub panFaxPhone_Resize(sender As Object, e As System.EventArgs) Handles panFaxPhone.Resize
            panFax.Width = (panFaxPhone.Width / 2) - 1
            panPhone.Width = (panFaxPhone.Width / 2) - 1
            panFax.Left = panFaxPhone.Width - panFax.Width
    End Sub

How can I get my controls to size correctly while still respecting the users choice for larger text (I don’t want to just set the AutoScaleMode to None) ?

Update:
After playing with this for a long time it seems to be a problem with anchors in the child controls. See this below image, the inner black box is the control with its border turned on, the text boxes (like name) are anchored left and right and should stretch to fill the control, but don’t.

enter image description here

  • 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-25T20:45:56+00:00Added an answer on May 25, 2026 at 8:45 pm

    It just plain seems like the default control scaling just isn’t working with the anchors. I don’t know why, and can’t explain it. But I did find a work around. See below code I added to the control. If you can provide an explanation, I would appreciate it.

        Private ChildControlScale As Double = 0
        Public Sub New()
    
            ' This call is required by the designer.
            InitializeComponent()
    
            ' Add any initialization after the InitializeComponent() call.
            ChildControlScale = txtAddress.Width / Me.Width
    
        End Sub
    
        Protected Overrides Sub ScaleControl(factor As System.Drawing.SizeF, specified As System.Windows.Forms.BoundsSpecified)
            MyBase.ScaleControl(factor, specified)
            If ChildControlScale <> 0 Then
                For Each ctrl As Control In Me.Controls
                    ctrl.Width = Me.Width * ChildControlScale
                Next
            End If
        End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In .NET C# 3.5 Winforms, I have a user control with some simple child
I have a few DependencyProperties defined in some custom user controls. I'd like for
I have a view that I want to add some custom drawing to. I
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have had some problems with authentication in ASP.NET. I'm not used most of
I have a set of custom user controls, of type ChartControl. I want to
I have developed some custom DAO-like classes to meet some very specialized requirements for
We have a project where a vendor produces some custom code for us and
I'd like to make some custom MenuHeaders in WPF so I can have (for
I have inherited a visual studio 2003 project which uses some custom build steps.

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.