المشروع الأول
الكود
Private Sub Command11_Click()
End
End Sub
Private Sub Form_Load()
Picture1.Scale***** = 10
Picture1.Scale****** = 5
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim msgString As String
Dim ix As Integer
Dim iy As Integer
' extract the integer part of the mouse x & y position
ix = Int(X)
iy = Int(Y)
' if the mouse is over the space between buttons
' we wish to do nothing. empirical testing
' indicates that if the fractional part of x
' is greater than .84 or the fraction part of y
' is greater than .74 the mouse is over the space
' between buttons.
'
If ((X - ix) < 0.85) And ((Y - iy) < 0.75) Then
msgString = "you hit button " + Str$(ix * 5 + iy + 1)
MsgBox (msgString)
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim msgString As String
msgString = "x = " + Str$(X) + " y = " + Str$(Y)
************.Caption = msgString
End Sub