October 30, 2025, 05:27:58 PM

News:

IWBasic runs in Windows 11!


Listbox color

Started by Andy, March 02, 2012, 04:32:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

Silly question time but:

using the @listbox command and populating the listbox using the ADDSTRING command, can I change the color of an individual string in that listbox so it stands out?

In other words, 5 entries in the listbox, can you change the color for say entry 3?

I'm guessing no, but then again i'm usually wrong!

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

Found an example here on the forums by Sapero that showed how to add bitmaps to a listview.
I modified it a bit and came up with the attached example.

Hope it will let you do what you want.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Hi Larry,

Thanks, thats what I would like but i'm having difficulty incorporating it into the Browser_Test2Modified example. Just wanted to highlight an entry in the history list.

Will keep on trying!

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

What is the criteria you use to select the line to change the color on?
When is the color of a line to be changed?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

The attached causes item 2 (3rd entry in the 0 based list0 to be a different color.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Larry,

Thank you so much, thats great! I was highlighting a string that had a date in it.

Perfect!!!

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.