MegastoRM

Untitled

Aug 11th, 2013
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. Public Class Form1
  2. Dim broj1, broj2 As Integer
  3.  
  4. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5. If Len(TextBox1.Text) < 1 Or Len(TextBox2.Text) < 1 Then
  6. MsgBox("Unesi broj!")
  7. Else
  8. Label1.Text = broj1 + broj2
  9. End If
  10. End Sub
  11.  
  12. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  13. If IsNumeric(TextBox1.Text) Then
  14. broj1 = CInt(TextBox1.Text)
  15. Else
  16. MsgBox("Unesi broj!")
  17. End If
  18. End Sub
  19.  
  20. Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
  21. If IsNumeric(TextBox2.Text) Then
  22. broj2 = CInt(TextBox2.Text)
  23. Else
  24. MsgBox("Unesi broj!")
  25. End If
  26. End Sub
  27.  
  28. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  29. If Len(TextBox1.Text) < 1 Or Len(TextBox2.Text) < 1 Then
  30. MsgBox("Unesi broj!")
  31. Else
  32. Label1.Text = broj1 - broj2
  33. End If
  34. End Sub
  35.  
  36. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  37. If Len(TextBox1.Text) < 1 Or Len(TextBox2.Text) < 1 Then
  38. MsgBox("Unesi broj!")
  39. Else
  40. Label1.Text = broj1 / broj2
  41. End If
  42. End Sub
  43.  
  44. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  45. If Len(TextBox1.Text) < 1 Or Len(TextBox2.Text) < 1 Then
  46. MsgBox("Unesi broj!")
  47. Else
  48. Label1.Text = broj1 * broj2
  49. End If
  50. End Sub
  51. End Class
Advertisement
Add Comment
Please, Sign In to add comment