Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub CellPainting(sender As Object, e As DataGridViewCellPaintingEventArgs)
- If e.RowIndex >= 0 Then
- Dim item As cl_SetupUserAccess_SaaS.FeatureItem = sender.rows(e.RowIndex).DataBoundItem
- If Not item.Name = "TrialBalance" AndAlso e.ColumnIndex = sender.columns("Add").index Then
- Dim newRect As New Rectangle(e.CellBounds.X + 1, e.CellBounds.Y + 1, e.CellBounds.Width - 4, e.CellBounds.Height - 4)
- Dim backColorBrush As New SolidBrush(e.CellStyle.BackColor)
- Dim gridBrush As New SolidBrush(Color.DarkGray)
- Dim gridLinePen As New Pen(gridBrush)
- ' Erase the cell.
- e.Graphics.FillRectangle(backColorBrush, e.CellBounds)
- ' Draw the grid lines (only the right and bottom lines;
- ' DataGridView takes care of the others).
- e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, _
- e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, _
- e.CellBounds.Bottom - 1)
- 'e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, _
- ' e.CellBounds.Top, e.CellBounds.Right - 1, _
- ' e.CellBounds.Bottom)
- ' Draw the inset highlight box.
- 'e.Graphics.DrawRectangle(New Pen(New SolidBrush(e.CellStyle.SelectionBackColor)), newRect)
- e.Handled = True
- End If
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement