Want to change foreColor of some of the items in a ListBox

I am developing an attendance count system, where all the registered student in a class are shown in a listbox. But I want to show name of the students who are currently present in a may be GREEN color, and all other students in RED color by default. I can get the index of a each items but controlling only some of the items seems difficult to me.

say list is looking this way,

Ataur

Warda

Bappy

Devid

Lina

now only ataur and bappy are present, [ I received a string data from my hardware that confirms that they are in present ] from the database I can get the their id and from the listBox i can get the index as well. Now how do I change the forColor of only these two not others?

Pardon me if my question seems silly, I am very new at VB.net

Upvotes: 0

Views: 211

Answers (1)

Salvatore Previti
Salvatore Previti

Reputation: 9080

You cannot do that by default with windows forms. You have to draw your own list box item.

http://www.codeguru.com/forum/archive/index.php/t-301047.html

Upvotes: 1

Related Questions