Home All Groups Group Topic Archive Search About
Author
9 Nov 2006 12:21 AM
Sid Price
I would like to have the text of a label resize to fit the label control
itself. I understand that the other way around is possible, i.e. having the
control resize to display the text (autosize property) but I can not seem to
find any sample or technique suitable for what I need. My label control is
set to fill a resizable form and I would like the text to scale as the form
is resized.

Thanks,
Sid.

Author
9 Nov 2006 4:54 AM
Cor Ligthert [MVP]
Sid,

Just the Dock in my idea as it is in every control.

If that does not fit your problem, than the Anchor

Use it in the designer properties first than you get an idea,

I hope this helps,

Cor

Show quoteHide quote
"Sid Price" <s**@nowhere.com> schreef in bericht
news:Osso5T5AHHA.4472@TK2MSFTNGP03.phx.gbl...
>I would like to have the text of a label resize to fit the label control
>itself. I understand that the other way around is possible, i.e. having the
>control resize to display the text (autosize property) but I can not seem
>to find any sample or technique suitable for what I need. My label control
>is set to fill a resizable form and I would like the text to scale as the
>form is resized.
>
> Thanks,
> Sid.
>
>
Author
9 Nov 2006 10:06 AM
Stuart Nathan
My first thought was that you need to find the nearest font size to suit the
label height but this might then be too wide for the label.
I am afraid I don't have time to do this, but you could have a look at GDI+.
I would then use a Panel to draw the text on and I would look at the
StringFormat object to help do it. Top of my head this. Use Help for mo
info.
Author
9 Nov 2006 3:23 PM
Sid Price
Show quote Hide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OxVdVr7AHHA.3540@TK2MSFTNGP03.phx.gbl...
> Sid,
>
> Just the Dock in my idea as it is in every control.
>
> If that does not fit your problem, than the Anchor
>
> Use it in the designer properties first than you get an idea,
>
> I hope this helps,
>
> Cor
>

Thanks for the response Cor, this is exactly what I am doing. My label
control automatically fits the panel as it is resized. However, my question
was related to resizing the text on the label as the control itself is
resized.

Sid.
Author
9 Nov 2006 5:53 PM
Cor Ligthert [MVP]
Sid,

Just simple, don't do it, the result becomes ugly.

(You have to work with font settings, but it never fits)

Cor

Show quoteHide quote
"Sid Price" <s**@nowhere.com> schreef in bericht
news:%239E7KMBBHHA.1196@TK2MSFTNGP02.phx.gbl...
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:OxVdVr7AHHA.3540@TK2MSFTNGP03.phx.gbl...
>> Sid,
>>
>> Just the Dock in my idea as it is in every control.
>>
>> If that does not fit your problem, than the Anchor
>>
>> Use it in the designer properties first than you get an idea,
>>
>> I hope this helps,
>>
>> Cor
>>
>
> Thanks for the response Cor, this is exactly what I am doing. My label
> control automatically fits the panel as it is resized. However, my
> question was related to resizing the text on the label as the control
> itself is resized.
>
> Sid.
>