你可直接使用IMAGE控件,它也有各种鼠标事件。
Private Sub Image1_Click()
'写需执行的代码
End Sub
增加LINE控件数组:
Option Explicit
Dim i As Integer
Private Sub Form_Load()
For i = 0 To 3
Line1(i).Visible = False
Next
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 0 To 3
Line1(i).Visible = True
Next
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
For i = 0 To 3
Line1(i).Visible = False
Next
End Sub