I'm trying to graph a circle with a delay function with it. I know that using a timer is necessary. I created a code in timer1_click
Code of the graphing of circle:Code:Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Me.startDelay += 1 If Me.startDelay = 360 Then Me.Timer1.Stop() End If Me.Refresh() End Sub
Now how can I implement the timer delay to the graphing of the circle?Code:Private Sub Form1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles Me.Paint If DrawIt Then x = CType(TextBox1.Text, Integer) y = CType(TextBox2.Text, Integer) r = CType(TextBox3.Text, Integer) FillCircle(g, x, y, 3, Brushes.Black) DrawCircle(g, x, y, r, Pens.Red) End If End Sub Private Sub DrawCircle(ByVal g As Graphics, ByVal x As Single, ByVal y As Single, ByVal r As Single, ByVal p As Pen) g.DrawEllipse(p, x - r, y - r, r * 2, r * 2) End Sub Private Sub FillCircle(ByVal g As Graphics, ByVal x As Single, ByVal y As Single, ByVal r As Single, ByVal b As Brush) g.FillEllipse(b, x - r, y - r, r * 2, r * 2) End Sub




Reply With Quote
