title: DataGridView Image Button Cell - vb.Net
body: <p>Does anyone know how to programme up a “Delete Image Button” using an Icon for a DataGridView in Visual Studio .Net</p>
  
  <p>I am struggling find trying to get my last column to have a delete icon instead of the word "Delete" and I want to display a little dustbin icon.</p>
  
  <p>I have tried looking in that many places and I am unable to get this to work.</p>
  
  <pre><code>Private Sub dataGridView1_CellPainting(ByVal sender As Object, ByVal e As 
  
      DataGridViewCellPaintingEventArgs)
          If e.ColumnIndex = 1 AndAlso e.RowIndex &gt;= 0 Then
              e.Paint(e.CellBounds, DataGridViewPaintParts.All)
          Dim img As Image = Image.FromFile("C:\icon_delete.jpg")
              e.Graphics.DrawImage(img, e.CellBounds.Left + 10, e.CellBounds.Top + 5, 10, 10)
              e.Handled = True
          End If
      End Sub 
  </code></pre>
  
  <p>Would appreciate some help if anyone knows. Thanks in Advance. Kuldip.</p>