请问在Msflexgrid中如何用鼠标右键选定单元格,使得该单元格获得焦点.
操作就跟用鼠标左键,希望大家帮帮忙,谢谢!

解决方案 »

  1.   

    用API函数SwapMouseButton交换鼠标左右键的功能试一下
      

  2.   

    Private Declare Function SwapMouseButton Lib "user32" (ByVal bSwap As Long) As LongPrivate Sub Command1_Click()
        SwapMouseButton 1
    End SubPrivate Sub Command2_Click()
        SwapMouseButton 0
    End Sub
      

  3.   

    Private Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
        If Button = vbRightButton Then
            MSHFlexGrid1.Row = MSHFlexGrid1.MouseRow
            MSHFlexGrid1.Col = MSHFlexGrid1.MouseCol
        End If
    End Sub
      

  4.   

    Private Sub MSHFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
        If Button = vbRightButton Then
            MSHFlexGrid1.Row = MSHFlexGrid1.MouseRow
            MSHFlexGrid1.Col = MSHFlexGrid1.MouseCol
        End If
    End Sub