Jan 8, 2010
The program is for calculating an amount of fruit. I have a label saying the name of the fruit, a textbox to enter a value of 0-99 and another textbox with ReadOnly which will show the price.
View 14 Replies
A little picture here:[URL]
As you can see, the Fruit1 Etc... Is only the fruit name.
The Text box wich indicate 1-99 means the number of fruit.
The Textbox with Cash on it, means the total price.
The Calculate button, when I will push it, all the total price from all the fruit will be added together to form a total price which will be indicated in the total price textbox under the Calculate button.
When I will enter the number of fruit, if I enter 99, it give me a price.
When I will enter 60, I want that the 60 are multiplied by (let say) 0,10$
I just like to know how I can do this... Its really bothering e and I don't want to calculate all the things and make 99 line for 1 fruit cause it will be long.
The code I was using was:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = "99" Then
TextBox2.text = "10.00$"
Elseif TextBox1.Text = "98" Then
TextBox2.Text = "9,90$"
Until the the number of the fruit in the code reach 0. So its very long.