If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Display the whole caption into a Label

Goodmorning

I've this trouble: a Label must display a string of 40 characters and can fill at most a space of 4100x615 twips. But, if I set the AutoSize or WordWrap properties, the text exceeeds this space, and if I don't use them, Label won't show the whole text (because part of it will go over the control borders.

So, I got an idea: try to change Font size until text is fully contained into the control. But neither this works

Re: Display the whole caption into a Label

Well... looks like using the default font and your size label it holds 39 characters if those characters are all X or other character of that size on one line. Word wrap only works when there is a space so that does nothing for a continuous string of characters.

If I turn on word wrap and use a string which has a bunch of Xs with a space every 10 characters I can get 80 characters in that space with room to spare.

So it would seem that if you are using word wrap and an 8 pt font that your string must not have any spaces you could make this string wrap by adding a VBCRLF into the string at the point where you need it to wrap or by turning on word wrap and inserting a space where it needs to be wrapped.

Try this... place a label named label1 on the form with the size you specified, leave the font at the default and turn on word wrap. Place a command button on the form with the default name of command 1 then add this code and try it