vb msflexgrid 中的单元格如何获取选定矩形左上方和右下方单元格的行和列号!
1个回答
展开全部
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
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |