nightfire001
nightfire001

Reputation: 779

How to make label text right aligned in visual studio?

In Visual Studio, WinForms, I want to make the text of the label aligned to the right. I have used the property RightToLeft = Yes, but the problem as follows occur: The label Name : becomes : Name after the property RightToLeft = Yes is made. But I want to right aligned the label as Name :

Is there anyway to do so? Please help... I am using Visual Studio 2010

Upvotes: 1

Views: 9065

Answers (2)

cyberponk
cyberponk

Reputation: 1766

First of all, disable AutoSize, then use TextAlign property to set alignment. It won´t work with AutoSize enabled because it "auto-sizes" starting by left.

Upvotes: 0

CodeNaked
CodeNaked

Reputation: 41403

You should use the TextAlign property, not the RightToLeft property. The latter is used for localization to right-to-left languages.

Upvotes: 4

Related Questions