B
Bonna
Hi,
I have 2 label within a xpander control. (or another container for that
matter)
The contents of the labels are set dynamically (label.Text = ...).
I want to use a fixed width (the width of the container), but the label has
to span its text across multiple lines. (so the height is variable).
It is important to know the height of the first label, since I want to
position my second label just underneath it.
(secondlabel.top = firstlabel.top + firstlabel.height + 5px)
The problem is that when the first label receives new data (I've set the
label.Autosize property to true), it changes it's width to the text lenght
but doesn't span accross multiple lines...(so now the text is clipped in the
border) and therefore doesn't adjust the label.width property.
I assume this is because the labelcontrol doesn't know the boundaries of
it's container??
How do you resize the label at runtime? Can you set some kind of max. width
while still using autosize? Am I overlooking a property here?
Thanks in advance!
Bonna
I have 2 label within a xpander control. (or another container for that
matter)
The contents of the labels are set dynamically (label.Text = ...).
I want to use a fixed width (the width of the container), but the label has
to span its text across multiple lines. (so the height is variable).
It is important to know the height of the first label, since I want to
position my second label just underneath it.
(secondlabel.top = firstlabel.top + firstlabel.height + 5px)
The problem is that when the first label receives new data (I've set the
label.Autosize property to true), it changes it's width to the text lenght
but doesn't span accross multiple lines...(so now the text is clipped in the
border) and therefore doesn't adjust the label.width property.
I assume this is because the labelcontrol doesn't know the boundaries of
it's container??
How do you resize the label at runtime? Can you set some kind of max. width
while still using autosize? Am I overlooking a property here?
Thanks in advance!
Bonna