EJERCICIO SELECCION FIGURA
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim figura As String
Dim grafico As Graphics
Dim lapiz As Pen
If RadioButton1.Checked Then
figura = "circulo"
Else
If RadioButton2.Checked Then
figura = "linea"
Else
If RadioButton3.Checked Then
figura = " cuadrado"
End If
End If
End If
Select Case figura
Case "circulo"
grafico = CreateGraphics()
lapiz = New Pen(Color.PaleVioletRed, 4)
grafico.DrawEllipse(lapiz, 10, 10, 110, 300)
Case "linea"
grafico = CreateGraphics()
lapiz = New Pen(Color.Blue, 4)
grafico.DrawLine(lapiz, 10, 10, 100, 100)
Case " cuadrado"
grafico = CreateGraphics()
lapiz = New Pen(Color.Red, 4)
grafico.DrawRectangle(lapiz, 50, 50, 150, 150)
End Select
End Sub
No hay comentarios:
Publicar un comentario