¿Pasar filas salteadas o aleatorias de un MSFlexGrid a otro MSFlexGrid en vb 6.0?

tengo una aplicación que tengo 2
MSFlexGrid uno tiene información de la base de datos el otro se tiene
para pasar información del primero, de echo lo hace con shift pero si
lo quiero hacer separado utilizo el la tecla control y pero no lo
manda segundo MSFlexGrid, solo lo manda con shift
With MSFlexGrid2
.Clear
If MSFlexGrid1.ColSel = MSFlexGrid1.Col Then
.Rows = 1
.Cols = MSFlexGrid1.Cols
Exit Sub
End If
.FormatString = MSFlexGrid1.FormatString
.Rows = Abs(MSFlexGrid1.RowSel - MSFlexGrid1.Row) + 2
.FixedCols = MSFlexGrid1.FixedCols
.FixedRows = MSFlexGrid1.FixedRows
.Row = 1
.Col = 1
.RowSel = .Rows - 1
.ColSel = .Cols - 1
.Clip = MSFlexGrid1.Clip
End With
este es el código que ocupo para pasarlo y el código que ocupo para pasarlo con la tecla control este
Private Sub MSFlexGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = vbShiftMask Then m_booKeyShift = True
If Shift = vbCtrlMask Then m_booKeyCtrl = True
End Sub
Private Sub MSFlexGrid1_Keyup(KeyCode As Integer, Shift As Integer)
With MSFlexGrid1
m_booKeyCtrl = False
m_booKeyShift = False
End With
End Sub
Private Sub MSFlexGrid1_RowColChange()
With MSFlexGrid1
Static booBusy As Boolean
If m_booKeyShift Or booBusy Then Exit Sub
booBusy = True
Dim intThisCol As Integer, intThisRow As Integer
intThisCol = .Col
intThisRow = .Row
LockWindowUpdate .hwnd
If m_booKeyCtrl Then
.Col = 1
.Row = intThisRow
.ColSel = .Cols - 1
.RowSel = intThisRow
If .CellBackColor = .BackColorSel Then
.CellBackColor = .BackColor
.CellForeColor = .ForeColor
Else
.CellBackColor = .BackColorSel
.CellForeColor = .ForeColorSel
End If
Else
.Col = 1
.Row = 1
.ColSel = .Cols - 1
.RowSel = .Rows - 1
.FillStyle = flexFillRepeat
.CellBackColor = .BackColor
.CellForeColor = .ForeColor
.Col = 1
.Row = intThisRow
.ColSel = .Cols - 1
.RowSel = intThisRow
.CellBackColor = .BackColorSel
.CellForeColor = .ForeColorSel
End If
.Col = intThisCol
.Row = intThisRow
LockWindowUpdate 0&
booBusy = False
End With
End Sub
Private Sub MSFlexGrid1_SelChange()
With MSFlexGrid1
If Not m_booKeyShift Then Exit Sub
Dim intThisCol As Integer, intThisRow As Integer
intThisCol = .Col
intThisRow = .Row
Dim intNextCol As Integer, intNextRow As Integer
intNextCol = .ColSel
intNextRow = .RowSel
LockWindowUpdate .hwnd
'~~> Clear Screen
.Col = 1
.Row = 1
.ColSel = .Cols - 1
.RowSel = .Rows - 1
.FillStyle = flexFillRepeat
.CellBackColor = .BackColor
.CellForeColor = .ForeColor
'~~> Update Multiline
.Col = 1
.Row = intThisRow
.ColSel = .Cols - 1
.RowSel = intNextRow
.FillStyle = flexFillRepeat
.CellBackColor = .BackColorSel
.CellForeColor = .ForeColorSel
LockWindowUpdate 0&
Tag900:
.Col = intNextCol
.Row = intNextRow
End With
End Sub

Añade tu respuesta

Haz clic para o