Hiding the ListBox hi-light by returning True on the CellPressed event disables DoublePressed.
Is there way to suppress DesktopListbox hi-lighting without causing side effects to other events?
The example shows the dilemma.
HiLightLB.zip (8.9 KB)
Hiding the ListBox hi-light by returning True on the CellPressed event disables DoublePressed.
Is there way to suppress DesktopListbox hi-lighting without causing side effects to other events?
The example shows the dilemma.
HiLightLB.zip (8.9 KB)
Do your own drawing in the PaintCellBackground event is probably your best bet as I’d bet you want to use SelectedRowIndex. Otherwise, you just set SelectedRowIndex to -1. Or you can store the SelectedRowIndex in a property of your own then set it to -1 and reference your property value.
Thanks! Paint… events is the answer and I don’t see any side effects:
Function PaintCellBackground
g.DrawingColor=Color.Clear
Return True
End Function
Function PaintCellText
g.DrawingColor=Color.TextColor
End Function
I tried your second option setting SelectedRowIndex to -1 and it came close, except that the row briefly highlights when first clicked.
Me.SelectedRowIndex=-1 is in CellPressed, SelectionChanged, and MouseDown
This alone suppresses the background, but also makes the Text in the row turn white.
Function PaintCellBackground
g.DrawingColor=Color.Clear
End Function
Update: Just learned that hiding the DesktopListbox row hi-light only requires this much to work:
Function PaintCellBackground
Return True ’ results in no row hi-light
End Function
Function PaintCellText
g.DrawingColor=Color.TextColor ’ must give the text some color
End Function