Imports System.IO Imports System.Threading Public Class Form1 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 p2vbList As List(Of Object) Private myPen As Pen Private formGraphics As System.Drawing.Graphics Private myBrush As System.Drawing.SolidBrush Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load End Sub Public Sub main() Dim winWidth As Integer winWidth = 200 Dim winHeight As Integer winHeight = 300 Dim win As Integer Text = "Balloons" Width = winWidth + 100 p2vbW = winWidth Height = winHeight + 100 p2vbH = winHeight p2vbX1 = 0 p2vbY1 = 0 p2vbX2 = winWidth p2vbY2 = winHeight ' right side up coordinates BackColor = System.Drawing.Color.Green Application.DoEvents() Dim base As Point base = New Point(100, 50) p2vbList = New List(Of Object)({New Point(50, 200), New Point(150, 220), New Point(100, 225)}) For center = 0 To p2vbList.Count - 1 Dim line As Integer Dim balloon As RectangleF formGraphics = CreateGraphics() myPen = New Pen(System.Drawing.Color.Red, 1) balloon.X = p2vbList(center).X balloon.Y = p2vbList(center).X balloon.Width = 40 balloon.Height = 40 formGraphics.DrawEllipse(myPen, balloon) myBrush = New System.Drawing.SolidBrush(System.Drawing.Color.Pink) formGraphics.FillEllipse(myBrush, balloon) Next ' Wait for a click to exit Dim message As New Label message.Left = p2vbW * ((winWidth / 2) / (p2vbX2 - p2vbX1)) message.Top = p2vbH - (p2vbH * ((20) / (p2vbY2 - p2vbY1))) message.Text = "Click anywhere to quit." message.AutoSize = True Controls.Add(message) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click main() End Sub End Class