Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/09/2008, 20:32
Avatar de robertgustavo
robertgustavo
 
Fecha de Ingreso: marzo-2008
Ubicación: Camaná - Arequipa
Mensajes: 213
Antigüedad: 16 años, 1 mes
Puntos: 4
De acuerdo Cargar una Imagen en DataGridViewButtonCell

Como haria para ponerle una imagen a una columna de datagridview del tipo button:DataGridViewButtonCell.



Estube probando este codigo: pero no funciona
la colunma es la numero 6.

Private Sub GridDetalleFactura_CellPainting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEvent Args) Handles GridDetalleFactura.CellPainting
If e.ColumnIndex = 6 And e.RowIndex >= 0 Then
e.Paint(e.CellBounds, DataGridViewPaintParts.All)
Dim celda As DataGridViewButtonCell = DirectCast(Me.GridDetalleFactura.Rows(e.RowIndex). Cells("Selecciona"), DataGridViewButtonCell)
Dim ico As New Icon("C:\Select.ico")
e.Graphics.DrawIcon(ico, e.CellBounds.Left + 3, e.CellBounds.Top + 3)
Me.GridDetalleFactura.Rows(e.RowIndex).Height = ico.Height + 10
Me.GridDetalleFactura.Columns(e.ColumnIndex).Width = ico.Width + 10
e.Handled = True
End If
End Sub

Última edición por robertgustavo; 24/09/2008 a las 20:46