رسم دايره هرجا از فرم كه دلتون ميخواد
اول بايد يه فرم درست كنيد بعد اين كدها رو توش بنويسي
Option Explicit
Dim X1 As Single, Y1 As Single, X2 As Single, Y2 As Single
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Refresh your start variables
X1 = X
Y1 = Y
X2 = X
Y2 = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
'Set the DrawMode to 6 indicates the next circle drawn will be an inverted line.
'This renders the circle invisible
'form1.DrawWidth = form1.DrawWidth + 10
Form1.DrawMode = 6
If Abs(X1 - X2) > 0 Then
'This draws an inverted circle over the previous line. Basically erasing it
Form1.Line ((X1 - 15) - Abs(X1 - X2), (Y1 - 15) - Abs(X1 - X2))-((X1 + 15) + Abs(X1 - X2), (Y1 + 15) + Abs(X1 - X2)), , B
Circle (X1, Y1), Abs(X2 - X1)
'Draw line
'form1.DrawWidth = form1.DrawWidth - 10
'DrawMode 13 is the default copy pen setting
'Form1.DrawMode = 13
'Refresh line ending values to current position
End If
X2 = X
Y2 = Y
If Abs(X1 - X2) > 0 Then Form1.Line ((X1 - 15) - Abs(X1 - X2), (Y1 - 15) - Abs(X1 - X2))-((X1 + 15) + Abs(X1 - X2), (Y1 + 15) + Abs(X1 - X2)), , B
Circle (X1, Y1), Abs(X1 - X2)
'Draw new line
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.Line ((X1 - 15) - Abs(X1 - X2), (Y1 - 15) - Abs(X1 - X2))-((X1 + 15) + Abs(X1 - X2), (Y1 + 15) + Abs(X1 - X2)), , B
Form1.DrawMode = 13
Circle (X1, Y1), Abs(X - X1), RGB(215, 0, 0)
End Sub