Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Math Operator Question with Reading lines And Writing Lines

I have a question, because i have watched numerous tutorials of thenewboston's JavaScript and VB tuts, but they don't explain a lot about using math operators and things like that with GUI.


How would I make it so when someone puts text in one box, then press a button, it runs that text through a math operator, then pops it out into another text box. This is my interpretation of it.

(CLICKS BUTTON)
TextBox1.readline()
TextBox1.(The Text? What would this be)() (Then The Math Operator)
(Math Operator OutPut).Writeline() into TextBox2


Code
TextBoxResult.Text = (Integer.Parse(TextBoxOperand1.Text) + Integer.Parse(TextBoxOperand2.Text)).ToString()

Expressions are parsed in similar fashion as in maths (BEDMAS) and you can use either constant (like: 10, 51.84 etc.) or code operands (TextBox.Text, Integer.Parse(TextBox.Text), Integer.Parse(TextBox.Text))

Examples:
Code
Dim myIntVariable as Integer = Integer.Parse(textbox.Text) * 10

Code
Dim average as Double = (Double.Parse(textbox1.Text) + Double.Parse(textbox2.Text)) / 2
(Mar 24, 2012 02:11 AM)hgdfhsdgdfgdfh Wrote:  
Code
TextBoxResult.Text = (Integer.Parse(TextBoxOperand1.Text) + Integer.Parse(TextBoxOperand2.Text)).ToString()

Expressions are parsed in similar fashion as in maths (BEDMAS) and you can use either constant (like: 10, 51.84 etc.) or code operands (TextBox.Text, Integer.Parse(TextBox.Text), Integer.Parse(TextBox.Text))

Examples:
Code
Dim myIntVariable as Integer = Integer.Parse(textbox.Text) * 10

Code
Dim average as Double = (Double.Parse(textbox1.Text) + Double.Parse(textbox2.Text)) / 2

Thank you so much Dead! You're the first person that hasn't flamed on one of my questions about VB!



Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by lockheadApr 22, 2021 07:10 AM 0 147 Apr 22, 2021 07:10 AM
Last Post: lockhead
[Python] by Mr. NihilousAug 14, 2020 02:33 PM 4 181 Aug 14, 2020 02:33 PM
Last Post: Mr. Nihilous
[C] by nuvexy.Oct 6, 2019 03:13 PM 13 517 Oct 6, 2019 03:13 PM
Last Post: themayonnaiseguy