Getting Dimensions of Multi-Lext on a PushButton - Using DrawText 
Author Message
 Getting Dimensions of Multi-Lext on a PushButton - Using DrawText

I am trying to retrieve the dimensiuons of multiline text on a pusbutton
using DrawText.

DrawText takes the hdc, the text , the no of chars, a pointer to a WinRect
structure, and a format flag.

When the format flag is set to DT_CALCRECT, the dimensions are determined
without drawing the text. The documentation states that if you specify the
max-width in the WinRect structure passed to the function, this will return
the milti-line dimension but it will only return a single line dimension.

Note: I have seen that if I include a carriage return in the text this
works but this is no use to me.

Thanks in advance for any help.

Dave Killian



Sun, 12 Dec 1999 03:00:00 GMT  
 Getting Dimensions of Multi-Lext on a PushButton - Using DrawText

Hi Dave:

Did you also set the DT_WORDBREAK flag?

Doug.



Quote:
> I am trying to retrieve the dimensiuons of multiline text on a pusbutton
> using DrawText.

> DrawText takes the hdc, the text , the no of chars, a pointer to a
WinRect
> structure, and a format flag.

> When the format flag is set to DT_CALCRECT, the dimensions are determined
> without drawing the text. The documentation states that if you specify
the
> max-width in the WinRect structure passed to the function, this will
return
> the milti-line dimension but it will only return a single line dimension.

> Note: I have seen that if I include a carriage return in the text this
> works but this is no use to me.

> Thanks in advance for any help.

> Dave Killian



Sun, 12 Dec 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB4-32: Multi-line caption on pushbutton, how????

2. Getting Default Printer Dimensions using API

3. How to refer to just *one* of the dimension of a multi-dimensional array in VBA

4. Multi-Dimension Arrays - how to pass to routines?

5. HLP: Sort Multi-Dimension Array

6. Passing Multi-Dimension Arrays from VB to DLL

7. How to a multi-dimension Alarm

8. newbie sorta -- multi-dimension arrays

9. Splitting a Multi-Dimension Array

10. Convert multi-dimension vbscript array to javascript array

11. multi dimension array

12. Getting the first dimension from an array...

 

 
Powered by phpBB® Forum Software