TIP: Click on subject to list as thread! ANSI
echo: delphi
to: GARY WEINFURTHER
from: SIMON HUGGINS
date: 1997-05-23 17:09:00
subject: Owner draw listboxes

Hi Gary,
On Saturday, 17 May 1997 at 08:35:16, Gary Weinfurther confused
me talking about: Owner draw listboxes to Simon Huggins
 GW> A control is not a handle. Try this:
[snip]
Thanks so much for that.
I fiddled around with your code and with Martin Maat's and got it working.
In the end I used:
temp:=(control as Tlistbox).items[index]+#0; {NB extra #0 char on end}
drawtext( (control as Tlistbox).canvas.handle, @temp, -1, Rect, 
T_WORDBREAK);
{NB -1 as length that way it can judge ;) }
in drawitem and...
temp:=(control as Tlistbox).items[index]+#0; {NB extra #0 char on end}
with (control as Tlistbox).canvas do
        r:=control.clientrect;
drawtext( (control as Tlistbox).canvas.handle,
          @temp,
          -1,        {NB -1 as length that way it can judge ;) }
          r,
          DT_WORDBREAK+DT_CALCRECT);
in measureitem
and
IT WORKS!!!!
THANK YOU and consider your self credited in my little app (I've already put
the label in the about box ;) )
Cheers,
bfn,
si.
Fido : 2:440/7.15   or   Internet : huggie@dial.pipex.com
Web  : http://dialspace.dial.pipex.com/huggie
.!. HHeellpp!!  HHooww  ccaann  II  sswwiittcchh LLooccaall EEcchhoo  OOFF  
?
--- Terminate 4.00/Pro
---------------
* Origin: Fou, con et anglais! (2:440/7.15)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.