How to disable the checkbox in the listview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I use checkbox in the listview, sometime, I want to disable these
checkboxes, any body knows how to do so?

Thanks advance
 
Handle the ItemChecked or ItemCheck event and set the NewValue back to the
CurrentValue in the supplied event args, i.e.:

Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As
System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
If e.Index = 0 Then
e.NewValue = e.CurrentValue
End If
End Sub

This will effectively prevent the user from changing the value


/claes
 
Back
Top