SHARE
TWEET

Windel eto na

a guest Jun 24th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class HesapMakinesi
  2.     Dim Firstnum As Decimal
  3.     Dim secondnum As Decimal
  4.     Dim Operations As Integer
  5.     Dim Operator_selctor As Boolean = False
  6.     Private Sub HesapMakinesi_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  7.  
  8.     End Sub
  9.  
  10.     Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  11.         If Operator_selctor = True Then
  12.             secondnum = TextBox1.Text
  13.             If Operations = 1 Then
  14.                 TextBox1.Text = Firstnum + secondnum
  15.             ElseIf Operations = 2 Then
  16.                 TextBox1.Text = Firstnum - secondnum
  17.             ElseIf Operations = 3 Then
  18.                 TextBox1.Text = Firstnum * secondnum
  19.             Else
  20.                 If secondnum = 0 Then
  21.                     TextBox1.Text = "Hata! L├╝tfen i┼čleminizi kontrol edin."
  22.                 Else
  23.                     TextBox1.Text = Firstnum / secondnum
  24.                 End If
  25.             End If
  26.             Operator_selctor = False
  27.         End If
  28.     End Sub
  29.  
  30.     Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
  31.  
  32.         If TextBox1.Text <> "0" Then
  33.             TextBox1.Text += "1"
  34.         Else
  35.             TextBox1.Text = "1"
  36.         End If
  37.     End Sub
  38.  
  39.     Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
  40.         If TextBox1.Text <> "0" Then
  41.             TextBox1.Text += "2"
  42.         Else
  43.             TextBox1.Text = "2"
  44.         End If
  45.     End Sub
  46.  
  47.     Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  48.         If TextBox1.Text <> "0" Then
  49.             TextBox1.Text += "3"
  50.         Else
  51.             TextBox1.Text = "3"
  52.         End If
  53.     End Sub
  54.  
  55.     Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click
  56.         If TextBox1.Text <> "0" Then
  57.             TextBox1.Text += "4"
  58.         Else
  59.             TextBox1.Text = "4"
  60.         End If
  61.     End Sub
  62.  
  63.     Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
  64.         If TextBox1.Text <> "0" Then
  65.             TextBox1.Text += "5"
  66.         Else
  67.             TextBox1.Text = "5"
  68.         End If
  69.     End Sub
  70.  
  71.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  72.         If TextBox1.Text <> "0" Then
  73.             TextBox1.Text += "6"
  74.         Else
  75.             TextBox1.Text = "6"
  76.         End If
  77.     End Sub
  78.  
  79.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  80.         If TextBox1.Text <> "0" Then
  81.             TextBox1.Text += "7"
  82.         Else
  83.             TextBox1.Text = "7"
  84.         End If
  85.     End Sub
  86.  
  87.     Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
  88.         If TextBox1.Text <> "0" Then
  89.             TextBox1.Text += "8"
  90.         Else
  91.             TextBox1.Text = "8"
  92.         End If
  93.     End Sub
  94.  
  95.     Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
  96.         If TextBox1.Text <> "0" Then
  97.             TextBox1.Text += "9"
  98.         Else
  99.             TextBox1.Text = "9"
  100.         End If
  101.     End Sub
  102.  
  103.     Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
  104.         If TextBox1.Text <> "0" Then
  105.             TextBox1.Text += "0"
  106.         End If
  107.     End Sub
  108.  
  109.     Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
  110.         TextBox1.Text = "0"
  111.     End Sub
  112.  
  113.     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  114.         If Not (TextBox1.Text.Contains(".")) Then
  115.             TextBox1.Text += ","
  116.         End If
  117.     End Sub
  118.  
  119.     Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  120.         Firstnum = TextBox1.Text
  121.         TextBox1.Text = ""
  122.         Operator_selctor = True
  123.         Operations = 1 ' = +
  124.     End Sub
  125.  
  126.     Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
  127.         Firstnum = TextBox1.Text
  128.         TextBox1.Text = ""
  129.         Operator_selctor = True
  130.         Operations = 2 ' - -
  131.     End Sub
  132.  
  133.     Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
  134.         Firstnum = TextBox1.Text
  135.         TextBox1.Text = ""
  136.         Operator_selctor = True
  137.         Operations = 3 '=x
  138.     End Sub
  139.  
  140.     Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
  141.         Firstnum = TextBox1.Text
  142.         TextBox1.Text = ""
  143.         Operator_selctor = True
  144.         Operations = 4 ' /
  145.     End Sub
  146.  
  147.     Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
  148.  
  149.     End Sub
  150. End Class
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top