amnon
Member
- Joined
- Dec 18, 2022
- Messages
- 16
- Programming Experience
- Beginner
Hello,
In DataGridView, I set up FullRowSelect., after clicking on a cell, I would like it to change color to white, and I managed to do that, but after the next click on another cell, the previously clicked cell is still white. I don't know how to get rid of the previous selection.
In DataGridView, I set up FullRowSelect., after clicking on a cell, I would like it to change color to white, and I managed to do that, but after the next click on another cell, the previously clicked cell is still white. I don't know how to get rid of the previous selection.
VB.NET:
Private Sub DataGridView1_CellMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick
Try
DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.SelectionBackColor = Color.White
Catch ex As Exception
Exit Try
End Try
End Sub