Cambiar color de celdas
Publicado por GERARDO (10 intervenciones) el 19/02/2010 10:11:44
Hola, he visto como cambiar el color de una celda en V.B. 2003, al parecer se puede hacer con esta sub, pero la incorporo y me da que System.Windows.Forms.DataGridViewCellFormattingEventArgs) no esta definido.
¿Tengo que importar algo? en cellformatting tambien me pone que no se puede envontrar el evento.
Private Sub Dgbonificaciones_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles Dgbonificaciones.CellFormatting
'If e.RowIndex < Me.Dgbonificaciones.RowCount - 1 Then
'Select Case Me.Dgbonificaciones.Item(1, e.RowIndex).Value.ToString
'Case 1
'Me.Dgbonificaciones.Rows(e.RowIndex).Cells(0).Style.BackColor = Color.AliceBlue
'Case 2
'Me.Dgbonificaciones.Rows(e.RowIndex).Cells(0).Style.BackColor = Color.Beige
'Case 3
'Me.Dgbonificaciones.Rows(e.RowIndex).Cells(0).Style.BackColor = Color.BurlyWood
'End Select
'End If
End Sub
¿Tengo que importar algo? en cellformatting tambien me pone que no se puede envontrar el evento.
Private Sub Dgbonificaciones_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles Dgbonificaciones.CellFormatting
'If e.RowIndex < Me.Dgbonificaciones.RowCount - 1 Then
'Select Case Me.Dgbonificaciones.Item(1, e.RowIndex).Value.ToString
'Case 1
'Me.Dgbonificaciones.Rows(e.RowIndex).Cells(0).Style.BackColor = Color.AliceBlue
'Case 2
'Me.Dgbonificaciones.Rows(e.RowIndex).Cells(0).Style.BackColor = Color.Beige
'Case 3
'Me.Dgbonificaciones.Rows(e.RowIndex).Cells(0).Style.BackColor = Color.BurlyWood
'End Select
'End If
End Sub
Valora esta pregunta


0