I have refereed the Colored List Box codebank entry by tassa. Using this i face a problem, whenever the listbox looses the focus, the selected item backcolor is changed to white.
How should i make the listbox to keep the backcolor.
Printable View
I have refereed the Colored List Box codebank entry by tassa. Using this i face a problem, whenever the listbox looses the focus, the selected item backcolor is changed to white.
How should i make the listbox to keep the backcolor.
I haven't checked out that code but the first thing to check is that HideSelection is False.
I couldn't find that property in an ListBox
Sorry. The ListView has that property and I was thinking that the ListBox did too but it seems not.
I'm not too sure about this, but I saw this in the code:
I too can remember using this check always (check for both Selected and Focus), but perhaps it has something to do with the Focus check. I would advice you to remove the Focus check altogether, but I can remember almost certainly that you will then not draw your items when you select them with the mouse. So I'm not really sure what to do, but perhaps it's still relevant.Code:If e.State = (DrawItemState.Selected Or DrawItemState.Focus) Then
Nope, removing the Focus check is also not working
is there any other way to keep the backcolor of the selected item