Public Class Form1
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Bus topology
'Picture box draws Lines
PictureBox1.CreateGraphics.DrawLine(Pens.Black, 10, 60, 10, 70)
PictureBox1.CreateGraphics.DrawLine(Pens.Black, 10, 60, 90, 60)
PictureBox1.CreateGraphics.DrawLine(Pens.Black, 30, 60, 30, 50)
PictureBox1.CreateGraphics.DrawLine(Pens.Black, 50, 70, 50, 60)
PictureBox1.CreateGraphics.DrawLine(Pens.Black, 70, 50, 70, 60)
PictureBox1.CreateGraphics.DrawLine(Pens.Black, 90, 60, 90, 70)
'Sphere drawings, fill ellipse
PictureBox1.CreateGraphics.FillEllipse(Brushes.Purple, 0, 70, 20, 20)
PictureBox1.CreateGraphics.FillEllipse(Brushes.Purple, 20, 30, 20, 20)
PictureBox1.CreateGraphics.FillEllipse(Brushes.Purple, 40, 70, 20, 20)
PictureBox1.CreateGraphics.FillEllipse(Brushes.Purple, 60, 30, 20, 20)
PictureBox1.CreateGraphics.FillEllipse(Brushes.Purple, 80, 70, 20, 20)
'Sphere drawings, draw ellipse
PictureBox1.CreateGraphics.DrawEllipse(Pens.Black, 0, 70, 20, 20)
PictureBox1.CreateGraphics.DrawEllipse(Pens.Black, 20, 30, 20, 20)
PictureBox1.CreateGraphics.DrawEllipse(Pens.Black, 40, 70, 20, 20)
PictureBox1.CreateGraphics.DrawEllipse(Pens.Black, 60, 30, 20, 20)
PictureBox1.CreateGraphics.DrawEllipse(Pens.Black, 80, 70, 20, 20)
End Sub
'Clears image
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'clears picture box 1
PictureBox1.Image = Nothing
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'Star topology
'Lines
PictureBox2.CreateGraphics.DrawLine(Pens.Black, 50, 20, 50, 50)
PictureBox2.CreateGraphics.DrawLine(Pens.Black, 20, 30, 80, 80)
PictureBox2.CreateGraphics.DrawLine(Pens.Black, 20, 80, 80, 30)
'Sphere drawings, draw ellipse
PictureBox2.CreateGraphics.FillEllipse(Brushes.Green, 40, 45, 20, 20)
PictureBox2.CreateGraphics.FillEllipse(Brushes.Green, 40, 10, 20, 20)
PictureBox2.CreateGraphics.FillEllipse(Brushes.Green, 10, 20, 20, 20)
PictureBox2.CreateGraphics.FillEllipse(Brushes.Green, 70, 20, 20, 20)
PictureBox2.CreateGraphics.FillEllipse(Brushes.Green, 10, 70, 20, 20)
PictureBox2.CreateGraphics.FillEllipse(Brushes.Green, 70, 70, 20, 20)
'Sphere drawings, fill ellipse
PictureBox2.CreateGraphics.DrawEllipse(Pens.Black, 40, 45, 20, 20)
PictureBox2.CreateGraphics.DrawEllipse(Pens.Black, 40, 10, 20, 20)
PictureBox2.CreateGraphics.DrawEllipse(Pens.Black, 10, 20, 20, 20)
PictureBox2.CreateGraphics.DrawEllipse(Pens.Black, 70, 20, 20, 20)
PictureBox2.CreateGraphics.DrawEllipse(Pens.Black, 10, 70, 20, 20)
PictureBox2.CreateGraphics.DrawEllipse(Pens.Black, 70, 70, 20, 20)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
'clears picture box 2
PictureBox2.Image = Nothing
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
'Tree topology
'Draws lines
PictureBox3.CreateGraphics.DrawLine(Pens.Black, 20, 30, 80, 90)
PictureBox3.CreateGraphics.DrawLine(Pens.Black, 50, 60, 80, 30)
PictureBox3.CreateGraphics.DrawLine(Pens.Black, 80, 90, 140, 30)
'Fill elipse
PictureBox3.CreateGraphics.FillEllipse(Brushes.Blue, 10, 20, 20, 20)
PictureBox3.CreateGraphics.FillEllipse(Brushes.Blue, 40, 50, 20, 20)
PictureBox3.CreateGraphics.FillEllipse(Brushes.Blue, 70, 20, 20, 20)
PictureBox3.CreateGraphics.FillEllipse(Brushes.Blue, 70, 80, 20, 20)
PictureBox3.CreateGraphics.FillEllipse(Brushes.Blue, 100, 50, 20, 20)
PictureBox3.CreateGraphics.FillEllipse(Brushes.Blue, 130, 20, 20, 20)
'Draws ellipse
PictureBox3.CreateGraphics.DrawEllipse(Pens.Black, 10, 20, 20, 20)
PictureBox3.CreateGraphics.DrawEllipse(Pens.Black, 40, 50, 20, 20)
PictureBox3.CreateGraphics.DrawEllipse(Pens.Black, 70, 20, 20, 20)
PictureBox3.CreateGraphics.DrawEllipse(Pens.Black, 70, 80, 20, 20)
PictureBox3.CreateGraphics.DrawEllipse(Pens.Black, 100, 50, 20, 20)
PictureBox3.CreateGraphics.DrawEllipse(Pens.Black, 130, 20, 20, 20)
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
'clears picture box 3
PictureBox3.Image = Nothing
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
'clears all picture boxes
PictureBox1.Image = Nothing
PictureBox2.Image = Nothing
PictureBox3.Image = Nothing
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
'calls the buttons so it can draw
Button1_Click(sender, e)
Button3_Click(sender, e)
Button5_Click(sender, e)
End Sub
End Class