首页 > 代码库 > LabelControl文本居中显示

LabelControl文本居中显示

https://www.devexpress.com/Support/Center/Question/Details/Q94915

If you set the AutoSizeMode to None, you will be able to set the Height and Width of the LabelControl,

and align the Text using the LabelControl.Appearance.TextOptions.HAlignment property.

If you need to align the Text to the right, set this property to DevExpress.Utils.HorzAlignment.Far. 

 

先设置AutoSizeMode为None,然后设置LabelControl.Appearance.TextOptions.HAlignment属性为Center

可以考虑设置控件的Height和Width

LabelControl文本居中显示