Disable row listbox

how to disable rows in the listbox

listbox1.addrow “One”
listbox1.addrow “Two”
listbox 1.addrow “Three”

how to disable row 2 so it cannot be selected

Thank you

You cannot do this as a property of the row
But you can stop it appearing selected by overriding the cellbackgroundpaint event, and painting in an ‘unselected’ color, then return true.
You might also select the next row down in code, if there is one.

or deselect it in the cellclick event if it is a row you don’t want to be selected.
(and also return true of course)

I try to make a trial code in cellclick event

If row = 2 Then
  Return True
  'doin nothing
End If

and it work !

Thank you very much @Jeff Tullin and @Jean-Yves Pochez …