Advertisement
Drifting

Untitled

Nov 5th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.00 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Private Sub txtsides_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsides.TextChanged
  4.         If txtsides.Text = 3 Then
  5.             lblshape.Text = ("Triangle")
  6.         ElseIf txtsides.Text = 4 Then
  7.             lblshape.Text = ("Quadrilateral")
  8.         ElseIf txtsides.Text = 5 Then
  9.             lblshape.Text = ("Pentagon")
  10.         ElseIf txtsides.Text = 6 Then
  11.             lblshape.Text = ("Hexagon")
  12.         ElseIf txtsides.Text = 7 Then
  13.             lblshape.Text = ("Heptagon")
  14.         ElseIf txtsides.Text = 8 Then
  15.             lblshape.Text = ("Octogon")
  16.         ElseIf txtsides.Text = 9 Then
  17.             lblshape.Text = ("Nonagon")
  18.         ElseIf txtsides.Text = 10 Then
  19.             lblshape.Text = ("Decagon")
  20.         End If
  21.  
  22.         If txtsides.Text > 10 Then
  23.             lblshape.Text = ("Error")
  24.         End If
  25.  
  26.         If txtsides.Text < 3 Then
  27.             lblshape.Text = ("Error")
  28.         End If
  29.  
  30.  
  31.     End Sub
  32. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement