Align autosize labels on the right

Z

ZippyV

Hello everybody,

A couple of years ago I wrote a program in VB6. Using the designer I could
align my labels to the right. When the text of the labels would change, the
autosize feature would kick in and resize the lables to the left.
But with vb.net it isn't possible anymore to get the labels aligned right
using Format -> Align -> Right and stay like that at runtime.
I tried using the anchor, docking and tablelayout panel, but none of these
things work.
Does somebody know a better solution?
 
K

Ken Tucker [MVP]

Hi,

You will have to align the labels with code in the labels text
changed event.

Ken
-------------------
Hello everybody,

A couple of years ago I wrote a program in VB6. Using the designer I could
align my labels to the right. When the text of the labels would change, the
autosize feature would kick in and resize the lables to the left.
But with vb.net it isn't possible anymore to get the labels aligned right
using Format -> Align -> Right and stay like that at runtime.
I tried using the anchor, docking and tablelayout panel, but none of these
things work.
Does somebody know a better solution?
 
C

Cor Ligthert

Ken,
You will have to align the labels with code in the labels text
changed event.
Are you sure of that, I use the Anchor with success in this kind of
operations.

There should be something that I oversee in this question?

Cor
 
K

Ken Tucker [MVP]

Hi,

The anchor property only moves the control when the form is resized.

Ken
-----------------
Ken,
You will have to align the labels with code in the labels text
changed event.
Are you sure of that, I use the Anchor with success in this kind of
operations.

There should be something that I oversee in this question?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top