|
-
Oct 29th, 2024, 04:18 AM
#11
Addicted Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by jpbro
Check out the EM_FORMATRANGE message and the FORMATRANGE structure. If you set the bounds of your target rectangle but use &H7FFFFFFF for the rc.Bottom property value and send the EM_FORMATRANGE to the RTB with a wParam of 0 (to just measure, not render) then the rc.Bottom will be set to the height of the formatted text in twips. If the .Bottom value remains at &H7FFFFFFF then you should assume a height of 0 twips.
Don't forget to cleanup when you are done by sending a second EM_FORMATRANGE message with wParam and lParam set to 0.
Thanks again jpbro, but uhmm, could you give me a little bit of the code, or don't you have it at hand...?
On the other hand, I think that the control itself should have 2 properties, textWidth and textHeight, to know how much the text takes up in many situations, like, for example, I'm going to use it to have full Unicode in a Tooltip and justified with de margins, with this way it will look very perfect to the eye, and there I need to know the width and height of the text, because in a ToolTip there can't be scroll bars...
Greetings jpbro, if you have the code at hand, if not, don't waste your time... Greetings to you and to everyone...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|