Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub txtsides_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsides.TextChanged
- If txtsides.Text = 3 Then
- lblshape.Text = ("Triangle")
- ElseIf txtsides.Text = 4 Then
- lblshape.Text = ("Quadrilateral")
- ElseIf txtsides.Text = 5 Then
- lblshape.Text = ("Pentagon")
- ElseIf txtsides.Text = 6 Then
- lblshape.Text = ("Hexagon")
- ElseIf txtsides.Text = 7 Then
- lblshape.Text = ("Heptagon")
- ElseIf txtsides.Text = 8 Then
- lblshape.Text = ("Octogon")
- ElseIf txtsides.Text = 9 Then
- lblshape.Text = ("Nonagon")
- ElseIf txtsides.Text = 10 Then
- lblshape.Text = ("Decagon")
- End If
- If txtsides.Text > 10 Then
- lblshape.Text = ("Error")
- End If
- If txtsides.Text < 3 Then
- lblshape.Text = ("Error")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement