kshadow22

Calculator Visual Basic

Jun 30th, 2015
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Button Nums
  2. Textbox1.AppendText("0")
  3. =====================
  4. 'Add/Sub/Div/Mul Buttons
  5. Label1.Text = "+"
  6. My.Settings.First = TextBox1.Text
  7. TextBox1.Text = ""
  8. My.Settings.Save()
  9. =======================
  10. 'Equals Button
  11. If Label1.Text = "+" Then
  12. TextBox1.Text = Val(My.Settings.First) + Val(TextBox1.Text)
  13. Else
  14. If Label1.Text = "-" Then
  15. TextBox1.Text = Val(My.Settings.First) - Val(TextBox1.Text)
  16. Else
  17. If Label1.Text = "*" Then
  18. TextBox1.Text = Val(My.Settings.First) * Val(TextBox1.Text)
  19. Else
  20. If Label1.Text = "/" Then
  21. TextBox1.Text = Val(My.Settings.First) / Val(TextBox1.Text)
  22. End If
  23. End If
  24. End If
  25. End If
RAW Paste Data