Hello,
I have a question,
I want fill in a textbox for example 25 + 25
and in a label you can find the result 50
can anyone help me?
Hello,
I have a question,
I want fill in a textbox for example 25 + 25
and in a label you can find the result 50
can anyone help me?
It really depends how complex you want the expressions to be.
https://www.google.com.au/search?q=p...ient=firefox-a
Here's one solution:
Dim op1 As Integer = 25
Dim op2 As Integer = 25
Dim ans As Integer = op1 + op2
Textbox1.Text = op1 & " + " & op2
Label1.Text = ans.ToString()
I think the idea was that the user would type the expression into the TextBox and the app would parse it and display the result.
If all you ever want to do is add two numbers then it's easy, but it becomes more and more difficult as you want to be able to use additional operators and longer expressions. Some the examples in the Google search I linked to will allow you to parse arbitrarily complex mathematical expressions.
Bookmarks