thesleepylizard
Programmer
Hi guys,
The VB Label control has an "autosize" property. If this is true, then the label will automatically resize itself horizontally to snugly fit the text it's given.
Now, I want to do a similar with with a Textbox. And, I want it to keep the WIDTH the same, but, resize itself vertically and spread the text over multiple lines. So I might set the text to "The quick brown fox jumps over the lazy dog", and it would format it as:
And, most important, ensuring that it resizes itself vertically to display ALL the text, with on scrollbars required.
Any ideas how to do this? I started writing a routine based on analyising the string and using the .TextHeight and .TextWidth properties of the form to intelligent figure things out, and I'm happy to do this if I have to. I want to avoid using special .OCXs and stick with the standard VB controls.
Thanks for your time,
-lizard
The VB Label control has an "autosize" property. If this is true, then the label will automatically resize itself horizontally to snugly fit the text it's given.
Now, I want to do a similar with with a Textbox. And, I want it to keep the WIDTH the same, but, resize itself vertically and spread the text over multiple lines. So I might set the text to "The quick brown fox jumps over the lazy dog", and it would format it as:
Code:
The quick brown
fox jumps over
the lazy dog
And, most important, ensuring that it resizes itself vertically to display ALL the text, with on scrollbars required.
Any ideas how to do this? I started writing a routine based on analyising the string and using the .TextHeight and .TextWidth properties of the form to intelligent figure things out, and I'm happy to do this if I have to. I want to avoid using special .OCXs and stick with the standard VB controls.
Thanks for your time,
-lizard