请问我写的右键菜单不正确怎么办?
我用MSHFlexGrid写的文件记录的表右键菜单的代码是:PrivateSubMSHFlexGrid_MouseUp(ButtonAsInteger,ShiftAsIn...
我用MSHFlexGrid写的文件记录的表右键菜单的代码是:
Private Sub MSHFlexGrid_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)If Button = 2 ThenMSHFlexGrid.RowSel = MSHFlexGrid.MouseRowPopupMenu RightEnd IfEnd Sub可每回点右键选择的都不是我想要的那行,而是多选的行,如下图
请问代码要怎么改才成?
先谢谢了 展开
Private Sub MSHFlexGrid_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)If Button = 2 ThenMSHFlexGrid.RowSel = MSHFlexGrid.MouseRowPopupMenu RightEnd IfEnd Sub可每回点右键选择的都不是我想要的那行,而是多选的行,如下图
请问代码要怎么改才成?
先谢谢了 展开
1个回答
展开全部
在MSHFlexGrid.RowSel = MSHFlexGrid.MouseRow这句之前加上下面的代码试试
If MSHFlexGrid.MouseRow > 0 Then
MSHFlexGrid.Row = MSHFlexGrid.MouseRow - 1
Else
MSHFlexGrid.Row = MSHFlexGrid.MouseRow
End If
If MSHFlexGrid.MouseRow > 0 Then
MSHFlexGrid.Row = MSHFlexGrid.MouseRow - 1
Else
MSHFlexGrid.Row = MSHFlexGrid.MouseRow
End If
追问
请问我可不可以给MSHFlexGrid.MouseRow赋空值,要是能赋空值问题就解决了,可我用MSHFlexGrid.MouseRow=nothing或MSHFlexGrid.MouseRow=null都不行,请问怎么办?
先谢谢了
追答
我也试过,貌似不能
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询