Option Explicit Public: Single Single Single String
Option Explicit Public: Single Single Single String
Option Explicit Public: Single Single Single String
20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button8.Click TextBox1.Text = TextBox1.Text & "8" Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button7.Click TextBox1.Text = TextBox1.Text & "7" End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button6.Click TextBox1.Text = TextBox1.Text & "6" End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button5.Click TextBox1.Text = TextBox1.Text & "5" End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button4.Click TextBox1.Text = TextBox1.Text & "4" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button3.Click TextBox1.Text = TextBox1.Text & "3" End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button2.Click TextBox1.Text = TextBox1.Text & "2" End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button1.Click TextBox1.Text = TextBox1.Text & "1" End Sub Dim FirstNumber As Single Dim SecondNumber As Single Dim AnswerNumber As Single Dim ArithmeticProcess As String
38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74.
End Sub Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles Button9.Click TextBox1.Text = TextBox1.Text & "9" End Sub Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button10.Click TextBox1.Text = TextBox1.Text & "0" End Sub Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button11.Click TextBox1.Text = TextBox1.Text & "." End Sub Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button17.Click TextBox1.Clear() End Sub Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button16.Click FirstNumber = Val(TextBox1.Text) TextBox1.Text = "0" ArithmeticProcess = "/" End Sub Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button15.Click FirstNumber = Val(TextBox1.Text) TextBox1.Text = "0" ArithmeticProcess = "X" End Sub Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button14.Click FirstNumber = Val(TextBox1.Text) TextBox1.Text = "0" ArithmeticProcess = "-" End Sub Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button13.Click
75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104.
FirstNumber = Val(TextBox1.Text) TextBox1.Text = "0" ArithmeticProcess = "+" End Sub Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System .EventArgs) Handles Button12.Click SecondNumber = Val(TextBox1.Text) If ArithmeticProcess = "+" Then AnswerNumber = FirstNumber + SecondNumber End If If ArithmeticProcess = "-" Then AnswerNumber = FirstNumber - SecondNumber End If If ArithmeticProcess = "X" Then AnswerNumber = FirstNumber * SecondNumber End If If ArithmeticProcess = "/" Then AnswerNumber = FirstNumber / SecondNumber End If TextBox1.Text = AnswerNumber End Sub Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.Even tArgs) Handles MyBase.Load End Sub Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As percentage.ShowDialog() End Sub End Class