Click to See Complete Forum and Search --> : change fontcolor in a listbox


Maarten Versteeg
January 12th, 2000, 04:41 AM
Hi,

In a listbox (List1) I've added a few lines.
When I step through the listbox and push a button (Command1), the font of the line which is selected on that moment, has to change color.
Only the line which is selected has to change, so not the whole listbox.
When I step trough the listbox again, the font which was changed has to stay that color, until I select (with the button) another line. The previous selected line has to change back to the default color and the selected line has to change font color again.

I have a way to do this, but it will affect all applications and Windows screens, but I only want to do this in my VB application.

Does anyone has a solution.

Thanx a lot,
Maarten

Kolcho
January 12th, 2000, 07:46 AM
You can have only one color in a listbox (and also only one font).
If you want to use multiple colors in one control, try MS Flexgrid control - there you can use separate colors for all cells.

Chris Eastwood
January 12th, 2000, 07:50 AM
If you use VB6 then you can use the ListView to show different coloured items in the list.

If you must use a VB5 or want to use a listbox, then you can get code for a multi-lined / icon / coloured / all-singing-all-dancing listbox from http://www.geocities.com/SiliconValley/Foothills/9940 (called mList I think....)




Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb