Weird AutoSize Label

I like User Interfaces where the label with the description is beneath the textbox where you input the data...

Like this:


The Labels have 2 important properties set:


this.label1.AutoSize = true;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;


BUT!!!!!!

When i change the text of the label in my code
(maybe localize it?)

It looks like this!



Grrr!!!
I have expected that it would be aligned right....


SOLUTION:
Dont use the AutoSize property, set it to false.
Set the width (Size) large enough...


this.label1.AutoSize = false;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.label1.Size = new System.Drawing.Size(100, 13);

Latest Posts

Popular Posts