Can anyone help me on how to do this..
I have a ListView with Checkboxes in vb.net and what I want to do is when the user check the checkbox, the开发者_如何转开发 program ignore the response of the user in checking the checkbox, instead it leaves the checkbox uncheck..
This concern is uses for may validation..
Thanks for your positive response regarding this..
Edit, removed untested solution.
Private Sub ListView1_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
    e.NewValue = CheckState.Unchecked
End Sub
Dim lastUndo As Boolean = False
Private Sub thisListView_ItemChecked(sender As System.Object, e As System.Windows.Forms.ItemCheckedEventArgs) Handles thisListView.ItemChecked
    If lastUndo Then
        lastUndo = False
    Else
        If thisListView.Focused Then
            lastUndo = True
            e.Item.Checked = Not e.Item.Checked
        End If
    End If
End Sub
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论