Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Category:
Coding, syntax & commands
>>Does anyone know if it is possible to determine the correct height of a label such that all wrapped text (ie all lines) are visible?
>>
>>For example, if my label's caption is, "This is a very long caption which has word wrap set on..." and I set word wrap to .T. and anchor it such that it stretches horizontally, how can I programatically determine the label's height in order to show the full caption (when it wraps).
>>
>>TIA
>>Mike
>
>I don't think you need to calculate the height. You just need to set the width to a firm number and set the label's AutoSize to .T.
You are correct. My situation, however, is that I have a label in a container. The label's height does indeed get automatically determined, but I cannot get the container's height to adjust accordingly.
In my Init of the container, I set the label's AutoSize to .T., WordWrap to .T. and Caption. Immediately after this, I set the container's height to the label's height, but it does not adjust (grow taller with the label). If I put code in the container's Resize to set its height to the label's height then things look fine. If I put code in the container's Init to call the container's Resize event, nothing happens and the label appears chopped off.
Do you have any idea how I can have the container adjust its height to the label's height.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only