At run-time, I am adding a DataGridView to a windows form. The final column is a DataGridViewImageColumn:
Dim InfoIconColumn As New
Try This:
Private Sub DataGridView1_CellPainting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
If e.RowIndex > -1 Then
If e.ColumnIndex = -1 Then
e.Paint(e.CellBounds, DataGridViewPaintParts.Focus And Not DataGridViewPaintParts.ContentForeground)
DataGridView1.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single
e.Graphics.DrawImage(IconImg, e.CellBounds)
e.Handled = True
'DataGridView1.RowHeadersWidth = 100
'DataGridView1.ColumnHeadersHeight = 25
End If
End If