In the WinForm project, it is often used to align the boundaries, which facilitates the aesthetics of the UI design.
For the two label controls above, you need to align them right, which allows you to right-align by first selecting two controls and clicking Right-aligned as shown in.
However, in the project, it is unavoidable to dynamically modify the contents of the control, increase or decrease
This will appear to be right-aligned, because the control content is modified, resulting in it cannot be right-justified.
The control needs to be processed at this time.
The first step:
Set its Anchor property to change from Top,left to Top,right.
Step two: Set the RightToLeft property and change from No to Yes.
The third step: Modify the AutoSize property, change from True to false, and then lengthen the length of the label.
Effect.
VS Winfom Control Right Alignment implementation method