Private Sub DataGridView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseClick rcdraw = DataGridView1.GetCellDisplayRectangle(DataGridView1.CurrentCell.ColumnIndex, DataGridView1.CurrentCell.RowIndex, False) If DataGridView1.CurrentCell.Selected = True Then selection = True Else selection = False End If End Sub Private Sub DataGridView1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles DataGridView1.Paint If selection = True Then DrawEllipseRectangle(e) Else End If End Sub Private Sub DrawEllipseRectangle(ByVal e As PaintEventArgs) Dim redPen As New Pen(Color.Red, 3) Dim rect As New Rectangle(0, 0, 200, 100) e.Graphics.DrawEllipse(redPen, rcdraw) End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)