Share via

Why the width of the user control not resize?

BenTam 1,806 Reputation points
2023-12-27T04:01:11.8366667+00:00

Dear All,

Please look at the following video and tell me why the custom user control does not resize when the form is resizing. Please note the anchor of the TableLayoutPanel containing the user control is set to "top, left, right", and there is no anchor setting for the custom user control.

TextBoxButton

Remove

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2023-12-27T06:26:30.2666667+00:00

    Hi @BenTam-3003 , Welcome to Microsoft Q&A,

    UserControl will not change because of this.

    You have several ways to choose.

    1. Manually adjust the size in the incident
    2. The simpler is to modify the Dock of TextBox at the design interface of UserControl as Fill. If you do n’t like TextBox and Button, you can choose to use a tablelayoutpanel to wrap the two controls and set their dock. If you want to not change, you can set it alone.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.