I want to draw like a small cross just in the center of the circle (shape).
How can I get the coordinates of the circle?
Do you recommend to use other different kind of circle? (I mean, not shape control).
Printable View
I want to draw like a small cross just in the center of the circle (shape).
How can I get the coordinates of the circle?
Do you recommend to use other different kind of circle? (I mean, not shape control).
Try something like this:
Code:Option Explicit
Private Sub Form_Click()
Dim centerX As Single
Dim centerY As Single
Dim X1 As Single
Dim X2 As Single
Dim Y1 As Single
Dim Y2 As Single
Me.Cls
centerX = Shape1.Left + Shape1.Width / 2
centerY = Shape1.Top + Shape1.Height / 2
X1 = centerX - 100
X2 = centerX + 100
Y1 = centerY
Y2 = centerY
Me.Line (X1, Y1)-(X2, Y2)
X1 = centerX
X2 = centerX
Y1 = centerY - 100
Y2 = centerY + 100
Me.Line (X1, Y1)-(X2, Y2)
End Sub
Just perfect Rhino, thanks.
The next thing I want to do is to draw automatically a straight line from the center of the circle to the circle, given a specific angle (from 0 to 359).
You will need to put some effort on your end... What you will need is calculate coords for the second point using few math functions.
You may search forum - I'm sure there samples already posted.
Please check-out the Circle Method in vbhelp...
How is that going to draw a cross in the center?
I thought you had already drawn the cross in the centre!
...
I did but you suggested to use Circle method and that's why I asked you how is it going to help solving OP question. :confused:
I thought the latest question from the OP was;
> I want to do is to draw ... a straight line from the center of the circle to the circle, given a specific angle