首页 > 其他分享 >DataGridViewCheckBoxCell单元格点击后立即更改选中状态

DataGridViewCheckBoxCell单元格点击后立即更改选中状态

时间:2023-06-12 22:57:28浏览次数:35  
标签:End Sub 单元格 WinForms 选中 DataGridView1 DataGridViewCheckBoxCell chkCell

 

 Private Sub DataGridView1_CellMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick
        If DataGridView1(e.ColumnIndex, e.RowIndex).GetType = GetType(WinForms.DataGridViewCheckBoxCell) Then
            Dim chkCell As WinForms.DataGridViewCheckBoxCell = DirectCast(DataGridView1(e.ColumnIndex, e.RowIndex), WinForms.DataGridViewCheckBoxCell)
            chkCell.Value = Not chkCell.Value
            DataGridView1.EndEdit()
        End If
 End Sub

 

标签:End,Sub,单元格,WinForms,选中,DataGridView1,DataGridViewCheckBoxCell,chkCell
From: https://www.cnblogs.com/rf8862/p/17476305.html

相关文章