16,717
社区成员
发帖
与我相关
我的任务
分享Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
If sz = -1 Then
DataGridView1.Rows(DataGridView1.CurrentRow.Index).DefaultCellStyle.BackColor = Color.DodgerBlue
sz = DataGridView1.CurrentCell.RowIndex
Me.Text = sz
Else
DataGridView1.Rows(sz).DefaultCellStyle.BackColor = Color.GhostWhite
DataGridView1.Rows(DataGridView1.CurrentRow.Index).DefaultCellStyle.BackColor = Color.DodgerBlue
sz = DataGridView1.CurrentCell.RowIndex
End If
End Sub
Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
If sz = -1 Then
DataGridView1.Rows(DataGridView1.CurrentRow.Index).DefaultCellStyle.BackColor = Color.DodgerBlue
sz = DataGridView1.CurrentCell.RowIndex
Me.Text = sz
Else
DataGridView1.Rows(sz).DefaultCellStyle.BackColor = Color.GhostWhite
DataGridView1.Rows(DataGridView1.CurrentRow.Index).DefaultCellStyle.BackColor = Color.DodgerBlue
sz = DataGridView1.CurrentCell.RowIndex
End If
End Sub