Jack
Jack

Reputation: 16724

how to set label position respecting the tabcontrol size?

I'm setting an text in the label that is variable, so I need set dynamically the position it.

For example:

text: baa

in form:

------------------
|             baa|
|                |
|                |
-----------------

text: baaaaaaaa

in form:

------------------
|       baaaaaaaa|
|                |
|                |
-----------------

ever in corner. how I do this? Thanks stackoverflow!

Upvotes: 1

Views: 446

Answers (2)

m.qayyum
m.qayyum

Reputation: 411

Set `Auto Size` property of label to `False` and `TextAlign` Property
to `MiddleRight`

Upvotes: 0

Reed Copsey
Reed Copsey

Reputation: 564333

You can set it's Dock property to Top and Right.

label.Dock = DockStyle.Top | DockStyle.Right;

Upvotes: 2

Related Questions