By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,639 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,639 IT Pros & Developers. It's quick & easy.

Re-size label text

P: n/a
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.
Nov 9 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

"Sid Price" <si*@nowhere.comschreef in bericht
news:Os**************@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.


Nov 9 '06 #2

P: n/a
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.
Nov 9 '06 #3

P: n/a

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:Ox**************@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.
Nov 9 '06 #4

P: n/a
Sid,

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

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

Cor

"Sid Price" <si*@nowhere.comschreef in bericht
news:%2****************@TK2MSFTNGP02.phx.gbl...
>
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:Ox**************@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.

Nov 9 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.