Hi all,
I thought I had this mastered last week. Can you take a look at this code for me? For some reason in the third textbox I get code instead of proper output:
Public Class Form1
Dim number1 As Integer
Dim number2 As Integer
Dim answer As Double
Dim operatorSymboladd As String
Dim operatorSymbolsub As String
Dim operatorSymbolmult As String
Dim operatorSymboldiv As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addbutt.Click
operatorSymboladd = "+"
Label3.Visible = True
Label3.Text += String.Concat(userInput1, operatorSymboladd, userInput2)
TextBox3.Text = (Integer.Parse(userInput1.Text) + Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles subbutt.Click
Label4.Visible = True
TextBox4.Text = (Integer.Parse(userInput1.Text) - Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles multbutt.Click
Label5.Visible = True
TextBox5.Text = (Integer.Parse(userInput1.Text) * Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles divbutt.Click
Label6.Visible = True
TextBox6.Text = (Integer.Parse(userInput1.Text) / Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False
End Sub
Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click
userInput1.Clear()
userInput2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
End Sub
Private Sub quitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles quitButton.Click
Me.Close()
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
End Sub
End Class
Attachment 99619
I thought I had this mastered last week. Can you take a look at this code for me? For some reason in the third textbox I get code instead of proper output:
Public Class Form1
Dim number1 As Integer
Dim number2 As Integer
Dim answer As Double
Dim operatorSymboladd As String
Dim operatorSymbolsub As String
Dim operatorSymbolmult As String
Dim operatorSymboldiv As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addbutt.Click
operatorSymboladd = "+"
Label3.Visible = True
Label3.Text += String.Concat(userInput1, operatorSymboladd, userInput2)
TextBox3.Text = (Integer.Parse(userInput1.Text) + Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles subbutt.Click
Label4.Visible = True
TextBox4.Text = (Integer.Parse(userInput1.Text) - Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles multbutt.Click
Label5.Visible = True
TextBox5.Text = (Integer.Parse(userInput1.Text) * Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles divbutt.Click
Label6.Visible = True
TextBox6.Text = (Integer.Parse(userInput1.Text) / Integer.Parse(userInput2.Text)).ToString()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False
End Sub
Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click
userInput1.Clear()
userInput2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
TextBox6.Clear()
End Sub
Private Sub quitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles quitButton.Click
Me.Close()
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
End Sub
End Class
Attachment 99619