Private Sub Form_Load() Dim I As Integer, J As Integer MSFlexGrid1.Rows = 20 MSFlexGrid1.Cols = 5 For I = 0 To 19 For J = 0 To 4 MSFlexGrid1.TextMatrix(I, J) = I & " 行 " & J & " 列" Next Next End SubPrivate Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 2 Then MsgBox MSFlexGrid1.MouseRow & " 行 " & MSFlexGrid1.MouseCol & " 列" End Sub
Dim I As Integer, J As Integer
MSFlexGrid1.Rows = 20
MSFlexGrid1.Cols = 5
For I = 0 To 19
For J = 0 To 4
MSFlexGrid1.TextMatrix(I, J) = I & " 行 " & J & " 列"
Next
Next
End SubPrivate Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then MsgBox MSFlexGrid1.MouseRow & " 行 " & MSFlexGrid1.MouseCol & " 列"
End Sub