‘第一种方法 Private Sub MSHFlexGrid1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) If MSHFlexGrid1.RowSel <> MSHFlexGrid1.Row Then MSHFlexGrid1.RowSel = MSHFlexGrid1.Row End Sub
‘第二种方法
Private Sub msh_Data_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If msh_Data.MouseRow = 0 Then Exit Sub
With msh_Data .Row = .MouseRow CURRENTROW = .Row .Col = 0 ‘如果是0则可以不选择多行 .ColSel = .Cols - 1 End With
End Sub
Private Sub msh_Data_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If msh_Data.MouseRow = 0 Then Exit Sub
With msh_Data .RowSel = CURRENTROW .ColSel = .Cols - 1 End With