|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Re-size label textI 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. 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. > > 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.
Show quote
Hide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message Thanks for the response Cor, this is exactly what I am doing. My label 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 > 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. 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. >
Learning OOP conceptual question
What do you call nested If...Then search loops? SortedList - bug or undocumented behavior ? convert idl to c# or tlb code collapsing in vb.net 2005 File Aging Program Iterating through a Hastable of objects Problem Adding and Using Resource Files Find a control on a form of a specific name Debugging UserControl |
|||||||||||||||||||||||