Label.AutoSize and right-side align

C

Christoffer

Hello, I have a form with a label on. The label is aligned to the right side
of the form and the label's anchor is set to Bottom, Right. This means that
if the label expands (due to the AutoSize property) it should expand to the
left. However, this is not done and the result is that the text in the label
is expanded to the right outside the form.

Is there a setting for expanding a Label to the left instead of the right
when using the AutoSize property?

Cheers,
Chris
 
A

Andrew Smith \(Infragistics\)

Basically, the answer is no. AutoSize is a function of the label control
whereby it simply adjusts its Size based on the contents. The Anchor and
Dock properties of a control are used by the parent control when processing
the its (the parent control's) Layout event. There isn't a property that
will accomplish what you are looking for. It sounds like you'll need to
catch the resize event of the label and update its location so that the
bottom right is anchored where you indicated or use a 3rd party layout
component/control.
 

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