Private Sub Blah_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D0) Then TextBox1.Text = TextBox1.Text + "0"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D1) Then TextBox1.Text = TextBox1.Text + "1"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D2) Then TextBox1.Text = TextBox1.Text + "2"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D3) Then TextBox1.Text = TextBox1.Text + "3"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D4) Then TextBox1.Text = TextBox1.Text + "4"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D5) Then TextBox1.Text = TextBox1.Text + "5"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D6) Then TextBox1.Text = TextBox1.Text + "6"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D7) Then TextBox1.Text = TextBox1.Text + "7"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D8) Then TextBox1.Text = TextBox1.Text + "8"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.D9) Then TextBox1.Text = TextBox1.Text + "9"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Decimal) Then TextBox1.Text = TextBox1.Text + "."
DecPoint.Enabled = False
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Add) Then Label2.Text = TextBox1.Text
Label3.Text = "Plus"
TextBox1.Clear()
DecPoint.Enabled = True
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Subtract) Then Label2.Text = TextBox1.Text
Label3.Text = "Take"
TextBox1.Clear()
DecPoint.Enabled = True
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Multiply) Then Label2.Text = TextBox1.Text
Label3.Text = "Times"
TextBox1.Clear()
DecPoint.Enabled = True
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Divide) Then Label2.Text = TextBox1.Text
Label3.Text = "Divide"
TextBox1.Clear()
DecPoint.Enabled = True
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then If Label3.Text = "Plus" Then
If Label3.Text = "Plus" Then
Dim Num1 As Decimal
Dim Num2 As Decimal
Num1 = Label2.Text
Num2 = TextBox1.Text
Dim Awn = Num1 + Num2
TextBox1.Text = Awn
End If
If Label3.Text = "Take" Then
Dim Num1 As Decimal
Dim Num2 As Decimal
Num1 = Label2.Text
Num2 = TextBox1.Text
Dim Awn = Num1 - Num2
TextBox1.Text = Awn
End If
If Label3.Text = "Times" Then
Dim Num1 As Decimal
Dim Num2 As Decimal
Num1 = Label2.Text
Num2 = TextBox1.Text
Dim Awn = Num1 * Num2
TextBox1.Text = Awn
End If
If Label3.Text = "Divide" Then
Dim Num1 As Decimal
Dim Num2 As Decimal
Num1 = Label2.Text
Num2 = TextBox1.Text
Dim Awn = Num1 / Num2
TextBox1.Text = Awn
End If
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad0) Then TextBox1.Text = TextBox1.Text + "0"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad1) Then TextBox1.Text = TextBox1.Text + "1"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad2) Then TextBox1.Text = TextBox1.Text + "2"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad3) Then TextBox1.Text = TextBox1.Text + "3"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad4) Then TextBox1.Text = TextBox1.Text + "4"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad5) Then TextBox1.Text = TextBox1.Text + "5"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad6) Then TextBox1.Text = TextBox1.Text + "6"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad7) Then TextBox1.Text = TextBox1.Text + "7"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad8) Then TextBox1.Text = TextBox1.Text + "8"
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.NumPad9) Then TextBox1.Text = TextBox1.Text + "9"
End Sub