Ver Mensaje Individual
  #7 (permalink)  
Antiguo 15/06/2010, 17:51
Avatar de eledgarr
eledgarr
 
Fecha de Ingreso: octubre-2008
Ubicación: La ciudad de la esperanza
Mensajes: 133
Antigüedad: 16 años, 4 meses
Puntos: 3
Respuesta: Imagen en DataGridView en vb 2008

Espera encontre algo mas



' crear columna para imagenes
Dim colImagen As DataGridViewImageColumn = New DataGridViewImageColumn()
colImagen.Name = "DatoImagen"
colImagen.HeaderText = "DatoImagen"

' añadir columna de imagen a la coleccion del grid
Me.grdDimCustomer.Columns.Add(colImagen)
End Sub

Private Sub grdDimCustomer_CellFormatting(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.DataGridViewCellFormattingEve ntArgs) Handles
grdDimCustomer.CellFormatting
If Me.grdDimCustomer.Columns(e.ColumnIndex).Name = "DatoImagen" Then
If Me.grdDimCustomer.Rows(e.RowIndex).Cells("Gender") .Value = "M" Then
e.Value = New Bitmap("c:\imagenes\libro.gif")
Else
e.Value = New Bitmap("c:\imagenes\NotaAzul.gif")
End If
Else
If Me.grdDimCustomer.Rows(e.RowIndex).Cells("Gender") .Value = "M" Then
e.CellStyle.ForeColor = Color.Black
Else
e.CellStyle.ForeColor = Color.Red
End If
End If
End Sub




me falto la fuente jajajaja

http://www.capitalfederal.com/foros/...01afeaf589cc45
__________________
Si te sirve lo que te escribo regalame un karma positivo
-----------------------------------------------------------------------
Estoy aqui no por que conozco mucho, estoy para ignorar menos

Última edición por eledgarr; 15/06/2010 a las 17:51 Razón: Me apendeje y me falto algo juaz juaz juaz