Thanks Alex
I wanted to try and avoid that as it is quite complicated and the label
control (generally) does a good job of wrapping its text.
I ended up subclassing the label control, adding a new AutoSize enum and
resizing the control using preferredwidth and preferredheight.
It is reasonably accurate except when I have really narrow labels and will
have to do for now.
Cheers
JB
"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:OJ**************@TK2MSFTNGP10.phx.gbl...
Hi, John
you can use Graphics.MeasureCharacterRanges and Graphics.MeasureString to
get necessary measurements.
MeasureString is useful when you don't need high precision - however for
big strings it is not too good. Some people recommend to use always range
function.
HTH
Alex
"John Baro" <jo***@NOSPAMmesware.com.au> wrote in message
news:bl******************@news-server.bigpond.net.au... If I have a label (AutoSize = false) with more text than can fit it
wraps downwards.
I need to determine how high the label needs to be to fit the whole of
the text in.
I can then put it into a scrolling panel and scroll it like a textbox.
Any ideas on how to do this or a more appropriate method are muchly
appreciated.
Cheers
JB