Posted by: wajahatabbas | November 29, 2005

TextAlign Property of Windows.Form.Label Control

I was just to hit my head after strucking my hands in this buggy thing. What i want is proper alignment for Label control for English & Arabic, i am working on a mutlilingual C# desktop applicaiton.

I tries a lot to manage it with by setting the property like

this.lblFirstName.TextAlign = System.Drawing.ContentAlignment.TopRight ;

But i didnt get the results, then i realize the buggy thing which is not allowing it to align is that AutoSize property of a label. If you make a control autosize = true, it wont allow you to align this.

After getting it autosize false, it works fine……

Simple thing, but tricky, and even not mentioned in sites….forums..

Regards,
Wajahat Abbas
http://www.wajahatabbas.com
http://www.dotnetpakistan.com

http://www.dotNetPakistan.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: