小编Kos*_*tas的帖子

以编程方式从另一个按钮单击 DataGridView 按钮单元格

我有一个关于DataGridView.NET 中的控制的问题。

DataGridView从工具箱中插入了一个,并将其与我在 Access 中设置的数据库连接起来。然后我添加了一列,其中包含任务面板编辑列中的按钮DataGridView

按钮的点击事件DataGridView工作没有问题!

DataGridView当我单击DataGridView. 我该怎么做?

DataGridView的代码是:

Private Sub dgvAnimSel_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) _
    Handles dgvAnimSel.CellContentClick
    Dim V As String = dgvAnimSel.Rows(e.RowIndex).Cells(0).Value
    If e.ColumnIndex = 3 Then
        If V = 1 Then
            If A1 = 1 Then
                'this is the uncheck state
                Me.dgvAnimSel.CurrentCell.Style.BackColor = Color.White
                Me.dgvAnimSel.CurrentCell.Style.ForeColor = Color.Black
                Me.dgvAnimSel.CurrentCell.Value = "Select"
                ItemTextNew = ItemTextOr + "1"
                ItemName = ListView1.FindItemWithText(ItemTextNew, False, 0, True)
                ListView1.Items.Remove(ItemName)
                A1 = …
Run Code Online (Sandbox Code Playgroud)

.net vb.net datagridview winforms

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

.net ×1

datagridview ×1

vb.net ×1

winforms ×1