vb msflexgrid 中的单元格如何获取选定矩形左上方和右下方单元格的行和列号!

 我来答
zx001z7d53
2012-03-12 · TA获得超过2万个赞
知道大有可为答主
回答量:2.4万
采纳率:52%
帮助的人:5682万
展开全部
Dim s As String

Private Sub Form_Load()
MSFlexGrid1.Rows = 15
MSFlexGrid1.Cols = 15
MSFlexGrid1.FixedRows = 0
MSFlexGrid1.FixedCols = 0
For i = 0 To MSFlexGrid1.Rows - 1
MSFlexGrid1.Row = i
For j = 0 To MSFlexGrid1.Cols - 1
MSFlexGrid1.Col = j
MSFlexGrid1.Text = j + i
Next j
Next i
End Sub

Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
s = MSFlexGrid1.MouseRow & " " & MSFlexGrid1.MouseCol
End Sub

Private Sub MSFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Me.Caption = s & " " & MSFlexGrid1.MouseRow & " " & MSFlexGrid1.MouseCol
End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式