Private p2vbW As Integer Private p2vbH As Integer Private p2vbX1 As Integer Private p2vbY1 As Integer Private p2vbX2 As Integer Private p2vbY2 As Integer Private myPen as Pen Private formGraphics As System.Drawing.Graphics Private myBrush As System.Drawing.SolidBrush ' Test animation and depth with function. ' ' from graphics import * ' import time Public Sub moveOnLine(shape As RectangleF, dx As Integer, dy As Integer, repetitions As Integer, delay As Single) for i = 0 To repetitions - 1 shape.X = shape.X + dx shape.Y = shape.Y + dy Threading.Thread.Sleep(delay * 1000) Next End Sub Public Sub main() Dim winWidth As Integer winWidth = 300 Dim winHeight As Integer winHeight = 300 Dim win As Integer Form1.Text = "Back and Forth" Form1.Width = winWidth + 100 p2vbW = winWidth Form1.Height = winHeight + 100 p2vbH = winHeight p2vbX1 = 0 p2vbY1 = 0 p2vbX2 = winWidth p2vbY2 = winHeight ' make right side up coordinates! Dim rect As Rectangle rect = New Rectangle(New Point(200, 90), New Point(220, 100)) myPen = New Pen(Drawing.Color.Black, 1) formGraphics = Form1.CreateGraphics() formGraphics.DrawRectangle(myPen, rect) myBrush = New System.Drawing.SolidBrush(System.Drawing.Color.blue) formGraphics.FillRectangle(myBrush, New Rectangle(200, 90, 220, 100)) Dim cir1 As RectangleF myPen = New Pen(Drawing.Color.Black, 1) cir1.X = 40 cir1.Y = 100 cir1.Width = 25 cir1.Height = 25 formGraphics.DrawEllipse(myPen, cir1) myBrush = New System.Drawing.SolidBrush(System.Drawing.Color.yellow) formGraphics.FillEllipse(myBrush, cir1) Dim cir2 As RectangleF myPen = New Pen(Drawing.Color.Black, 1) cir2.X = 150 cir2.Y = 125 cir2.Width = 25 cir2.Height = 25 formGraphics.DrawEllipse(myPen, cir2) myBrush = New System.Drawing.SolidBrush(System.Drawing.Color.red) formGraphics.FillEllipse(myBrush, cir2) moveOnLine(cir1, 5, 0, 46, .05) moveOnLine(cir1, -5, 0, 46, .05) ' Wait for a final click to exit Dim Control1 As New Label Control1.Left = p2vbW * ((winWidth/2) / (p2vbX2 - p2vbX1)) Control1.Top = p2vbH - (p2vbH * (( 20) / (p2vbY2 - p2vbY1))) Control1.Text = "Click anywhere to quit." Control1.AutoSize = True Form1.Controls.Add(Control1) End Sub 'main()