Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/10/2009, 17:35
jaredprincipiante
 
Fecha de Ingreso: octubre-2009
Mensajes: 1
Antigüedad: 15 años, 6 meses
Puntos: 0
Pregunta Colorear solo celdas seleccionadas en mshflexgrid

Buen dia, he estado investigando y haciendo pruebas para colorear solo celdas seleccionadas, no filas ni columnas completas solo las que se seleccionan con el mouse, utilizo el siguiente codigo y en teoria debe pintarlas pero solo pinta la primer celda, espero ustedes me puedan orientar en donde esta mi error, saludos y muchas gracias

Nota: el menu mnucolorear es submenu del popupmenu mnuRepintar

Private Sub mnucolorear_Click()
Dim i, j, k, l, m, n As Integer
i = MSHFlexGrid1.Row
j = MSHFlexGrid1.RowSel
k = MSHFlexGrid1.Col
l = MSHFlexGrid1.ColSel
'MsgBox MSHFlexGrid1.ColSel
For m = i To j
For n = k To l
MSHFlexGrid1.Row = j
MSHFlexGrid1.CellBackColor = RGB(255, 233, 233)
'MsgBox j
'MsgBox n
Next n
Next m
End Sub

Private Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton Then
' Depliega el menú PopUP
Me.PopupMenu mnuRepintar
End If
End Sub