I have a list view and need certain items within that view to be disabled, ie grayed out and the check value cannot be changed.
I created a new class called ExtListViewItem which inherits ListViewItem. All it does it change the forecolor of the text to gray if enabled is set to false:
Public Class ExtListViewItem
Private _Enabled As Boolean
Public Property Enabled() As Boolean
Enabled = _Enabled
Set(ByVal Value As Boolean)
_Enabled = Value
If _Enabled = False Then
Me.ForeColor = Color.Gray
Me.ForeColor = Color.Black
Now I need to stop the check event from firing if enabled is set to false on the ListView. The only event I can find to override that relates to the checking is:
Protected Overrides Sub OnItemCheck(ByVal ice As System.Windows.Forms.ItemCheckEventArgs)
I can't work out how to do it with this event. It's almost like you need a OnBeforeItemCheck.
Does anyone know how I can achive this?