Okay, im trying to write a simple calculator. Heres my code:
Public Class Form1
Dim value1 As Double
Dim value2 As Double
Dim sign As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = " " Then TextBox1.Text = "1" Else
TextBox1.Text = TextBox1.Text & "1"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
value1 = textbox1.text
If TextBox1.Text = " " Then TextBox1.Text = "2" Else
TextBox1.Text = TextBox1.Text & "2"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If TextBox1.Text = " " Then TextBox1.Text = "+" Else
TextBox1.Text = TextBox1.Text & "+"
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
value2= textbox1.Text
If sign = "-" Then TextBox1.Text = value1 - value2 Else
If sign = "+" Then TextBox1.Text = value1 + value2 Else
If sign = "*" Then TextBox1.Text = value1 * value2 Else
If sign = "/" Then TextBox1.Text = value1 / value2
If TextBox1.Text = " " Then TextBox1.Text = "=" Else
TextBox1.Text = TextBox1.Text & "="
End Sub
End Class
the problem i have is that the "value1= textbox1.Text" and "value2= textbox1.Text" don't work.
any help would be appreciated =)