Private Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.MSHFlexGrid1.Redraw = False
row1 = Me.MSHFlexGrid1.Row
End Sub
Private Sub MSHFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.MSHFlexGrid1.Row = row1
Me.MSHFlexGrid1.ColSel = 0
Me.MSHFlexGrid1.ColSel = Me.MSHFlexGrid1.Cols - 1
Me.MSHFlexGrid1.Redraw = True
End Sub
Private Sub Form_Load()
With MSHFlexGrid1 '设置控件属性
.SelectionMode = flexSelectionByRow '选择模式为按行选择
.AllowBigSelection = False
.FocusRect = flexFocusNone
End With
End Sub
Private Sub MSHFlexGrid1_SelChange() '选择范围改变事件
With MSHFlexGrid1
.Row = .RowSel
.Col = 0
.ColSel = .Cols - 1
End With
End Sub
Private Sub MSHFlexGrid1_SelChange()
Dim i As Long, lngRowNew As Long
With MSHFlexGrid1
lngRowNew = .Row
For i = 1 To .Cols - 1
.Row = m_lngRowOld
.Col = i
.CellBackColor = vbWhite
.Row = lngRowNew
.CellBackColor = vbBlue
Next
m_lngRowOld = lngRowNew
End With
End Sub