Le 9 sept. 06 à 18:08 Soir, Joe Huber a écrit:

At 2:57 PM +0200 9/9/06, Arnaud Nicolet wrote:
You'll have to use the CellTextPaint event of the listbox.

in this event, you have a graphics object, where you can first set the font and the colour, then use g.DrawString "^",x,y (x and y are parameters of the event which indicate the preferred location to draw the text, where the OS would draw it if you didn't handle that). Then, return true.

Yes, this is exactly right.

The one thing I'll add is that this same event will fire for EVERY cell in your listbox, and so you need use the Row and Column passed into this event to decide whether you want to draw text into this cell yourself (return True) or let RB draw the normal text into this cell (return False)

If you do want to draw your own text, then also use the Row and Column parameters to determine the correct text for this particular cell.

That's right for RB 2005 and more recents.
In the first post, he precises he's using RB 5.5, where, instead of RB 2005, these events only fire for row that are physically present.

In ALL versions of RB with the CellTextPaint event he has to use the Row and Column to decide whether he wants to override RB's text drawing and he also needs to use Row and Column to determine what data he needs to place in each cell. Those were the two points I was making, and are correct for all versions of RB with CellTextPaint events.

This idea of event driven drawing to each cell in the list can be very confusing because most other list box operations are driven using a loop to iterate over the listox cells. So it's worth being extra specific about how you need to use the Row and Column parameters to implement CellTextPaint.

The CellBackgroundPaint event does fire for every cell in your listbox in both 5.5 and 200x. With 5.5 it's "every populated" cell and with 200x it's "every visible" cell. :-)

It all depends on the definition of "is". :-)

Regards,
Joe Huber


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to