This is actually relatively simple to implement, provided that you are ready to transfer the hard work of P / Invoke to access functions that are built into your own Windows control but not exposed to .NET FW.
My answer here shows how this can be done using the TreeView control and given how similar the ListView is to the TreeView, it should not be particularly surprising that this can be done very accurately using the ListView.
All the code is needed here (make sure you add the Imports declaration for the System.Runtime.InteropServices ):
' P/Invoke declarations Private Const LVIF_STATE As Integer = &H8 Private Const LVIS_STATEIMAGEMASK As Integer = &HF000 Private Const LVM_FIRST As Integer = &H1000 Private Const LVM_SETITEM As Integer = LVM_FIRST + 76 <StructLayout(LayoutKind.Sequential, Pack:=8, CharSet:=CharSet.Auto)> _ Private Structure LVITEM Public mask As Integer Public iItem As Integer Public iSubItem As Integer Public state As Integer Public stateMask As Integer <MarshalAs(UnmanagedType.LPTStr)> _ Public lpszText As String Public cchTextMax As Integer Public iImage As Integer Public lParam As IntPtr End Structure <DllImport("user32.dll", CharSet:=CharSet.Auto)> _ Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByRef lParam As LVITEM) As IntPtr End Function ''' <summary> ''' Hides the checkbox for the specified item in a ListView control. ''' </summary> Private Sub HideCheckBox(ByVal lvw As ListView, ByVal item As ListViewItem) Dim lvi As LVITEM = New LVITEM() lvi.iItem = item.Index lvi.mask = LVIF_STATE lvi.stateMask = LVIS_STATEIMAGEMASK lvi.state = 0 SendMessage(lvw.Handle, LVM_SETITEM, IntPtr.Zero, lvi) End Sub
And then you can simply call the above method as follows:
Private Sub btnHideCheckForSelected_Click(ByVal sender As Object, ByVal e As EventArgs) ' Hide the checkbox next to the currently selected ListViewItem HideCheckBox(myListView, myListView.SelectedItems(0)) End Sub
Creating something similar to this (after clicking the "Hide check" button for tomatoes and cucumber items):

source share