kshadow22

Caclulator Visual Basic 2008

Mar 26th, 2014
138
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form3
  2.  
  3.     Private Sub Form3_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  4.         Form2.Show()
  5.     End Sub
  6.  
  7.     Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  8.  
  9.     End Sub
  10.  
  11.     Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
  12.         Try
  13.             If Label1.Text = "+" Then
  14.                 TextBox1.Text = Val(My.Settings.FirstSetting) + Val(TextBox1.Text)
  15.             End If
  16.             If Label1.Text = "-" Then
  17.                 TextBox1.Text = Val(My.Settings.FirstSetting) - Val(TextBox1.Text)
  18.             End If
  19.             If Label1.Text = "X" Then
  20.                 TextBox1.Text = Val(My.Settings.FirstSetting) * Val(TextBox1.Text)
  21.             End If
  22.             If Label1.Text = "/" Then
  23.                 TextBox1.Text = Val(My.Settings.FirstSetting) / Val(TextBox1.Text)
  24.             End If
  25.         Catch ex As Exception
  26.             MessageBox.Show(ex.Message.ToString, "Error")
  27.         End Try
  28.  
  29.  
  30.  
  31.     End Sub
  32.  
  33.     Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
  34.         Label1.Text = "X"
  35.         My.Settings.FirstSetting = TextBox1.Text
  36.         TextBox1.Text = ""
  37.         My.Settings.Save()
  38.     End Sub
  39.  
  40.     Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
  41.         Label1.Text = "/"
  42.         My.Settings.FirstSetting = TextBox1.Text
  43.         TextBox1.Text = ""
  44.         My.Settings.Save()
  45.     End Sub
  46.  
  47.     Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
  48.         Label1.Text = "+"
  49.         My.Settings.FirstSetting = TextBox1.Text
  50.         TextBox1.Text = ""
  51.         My.Settings.Save()
  52.     End Sub
  53.  
  54.     Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
  55.         Label1.Text = "-"
  56.         My.Settings.FirstSetting = TextBox1.Text
  57.         TextBox1.Text = ""
  58.         My.Settings.Save()
  59.     End Sub
  60.  
  61.     Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
  62.         TextBox1.AppendText("7")
  63.     End Sub
  64.  
  65.     Private Sub Button0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button0.Click
  66.         TextBox1.AppendText("0")
  67.     End Sub
  68.  
  69.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  70.         TextBox1.AppendText("1")
  71.     End Sub
  72.  
  73.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  74.         TextBox1.AppendText("2")
  75.     End Sub
  76.  
  77.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  78.         TextBox1.AppendText("3")
  79.     End Sub
  80.  
  81.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  82.         TextBox1.AppendText("4")
  83.     End Sub
  84.  
  85.     Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  86.         TextBox1.AppendText("5")
  87.     End Sub
  88.  
  89.     Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
  90.         TextBox1.AppendText("6")
  91.     End Sub
  92.  
  93.     Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
  94.         TextBox1.AppendText("8")
  95.     End Sub
  96.  
  97.     Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  98.         TextBox1.AppendText("9")
  99.     End Sub
  100.  
  101.     Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
  102.         TextBox1.AppendText(".")
  103.     End Sub
  104.  
  105.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  106.  
  107.     End Sub
  108. End Class
RAW Paste Data