TIP: Click on subject to list as thread! ANSI
echo: delphi
to: SIMON HUGGINS
from: MARTIN MAAT
date: 1997-04-29 22:17:00
subject: Owner draw listboxes

Hallo Simon
 SH> I have managed to create code which deals with putting items wider
 SH> than the list box onto two lines but not yet managed to get this
 SH> working for more than that. i.e. to recognise how many then loop
 SH> through for each one. 
 SH> I tried to set the height variable passed in OnmeasureItem and then
 SH> inspect it in OnDrawItem but it didn't work :(
It does work, be carefull not to rely on the Items[Index].Object value 
though, you cannot get to it for some from within MeasureItem for some 
reason. Setting Height for an item however should work just fine. The maximum 
height is 255 pixels. What is your problem exactly?
 SH> Is there any good reason why OnDrawItem can't be empty?
Well, you do want something to be drawn, right? The beauty of OwnerDraw mode 
is that nothing will be drawn unless you want it to. 
 SH> Is there a much more elegant solution (there must be somewhere) 
This is as elegant as it gets. Did you set the draw mode to 
OwnerDrawVariable?  You need to do this in order to be able to set the height 
of individual items.
Groeten, Martin.
--- FMail/386 1.02
---------------
* Origin: -=[ E-mail: m_maat@knoware.nl .......... ]=- (2:286/420.1)

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™.