Click here to Skip to main content
15,860,972 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i am visual basic 2010

i am Making a hotel bill in that there are two text boxes Quantity and Price

and last Total Text Box. i want code to multiply those Quantity and Price text boxes get multiplied and should appear in third Text Box Total

what is The code please tell me
quantity text box name i given name was "QuantityTextBox""
Price text box i given name was "PriceTextBox""
total Text Box Name was "TotalTextBox"

based on this names i want code
Posted
Updated 7-Jun-21 16:02pm

1 solution

C#
int qty = int.Parse(QuantityTextBox.Text);
int price = int.Parse(PriceTextBox.Text);

int total= qty * price;

TotalTextBox.Text = total.ToString();
 
Share this answer
 
v2
Comments
ridoy 28-Nov-12 11:46am    
+5
[no name] 28-Nov-12 21:49pm    
int qty = int.Parse(QuantityTextBox.Text);
int price = int.Parse(PriceTextBox.Text);

int total= qty * price;

TotalTextBox.Text = total.ToString();


see those underlines iam getting in coding section

errors that araised at qty is "method arguments must be enclosed in paranthesys"
errors that araised at int "over resolution failed no accessbile int accepts this number of arguments"
errors that araised at method "method arguments must be enclosed in paranthesys"

qty *price error is "qty and price are not declared due to protection level"

i came across these errors when i double click total textbox and entered the code

please send new code according to errors and corrections that need to made
[no name] 29-Nov-12 3:43am    
OK.. Can I see your code ??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900