Right-aligned labels in WinForms

后端 未结 9 1514
甜味超标
甜味超标 2021-01-07 15:59

The most obvious way to right-align a Label in WinForms doesn\'t work: setting anchor to Top/Bottom Right and TextAlign to TopRight. If the text changes the lab

9条回答
  •  庸人自扰
    2021-01-07 16:31

    Here's what worked for me on a standard form

    • Set AutoSize property off for just the Labels to be right aligned
    • Make all the fields the same size (perhaps this isn't really required) using the Layout toolbar
    • Multi-select the labels and right align them using the Layout toolbar, position where desired
    • Set TextAlign property to one of the xxxRight settings, e.g, TopRight

提交回复
热议问题