On Dec 22, 2004, at 2:58 PM, KamaShin wrote:
I'm quite surprised to be stucked by something that seems so trivial:
I use a listbox to store numbers and I'd simply like to have the
negative numbers to be written in red while the positive ones would
remain in black... is it even doable? I tried to play a bit around the
ListBox.ActiveCell thing but this only allows the text to be in red
whil the cell is in edit mode, when being validated it goes back to
being written in black...
You can take over the drawing of the text [TextCellPaint() Event] and
do whatever you want. This allows you to treat each listbox cell as a
separate Canvas. But if you handle the text drawing yourself, you also
need to handle things like shorting strings that are too long.
I used this trick myself to have multiple sizes and rows of text in a
single Listbox cell. I was basing my UI on iChat.
_______________________________________________
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>
|