如何计算两个文本框的乘积并打印到第三个文本框 [英] How to Caluculate The Product of two text boxes and print to Third Text Box

查看:89
本文介绍了如何计算两个文本框的乘积并打印到第三个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Visual Basic 2010

我正在制作酒店帐单,其中有两个文本框,数量和价格

最后一个总文本框.我希望代码将那些数量"和价格"文本框相乘,并应出现在第三个文本框总计"中.

代码是什么,请告诉我
我给定名称的数量文本框名称为"QuantityTextBox""
我给定名称的价格文本框为"PriceTextBox""
文本框的总名称为"TotalTextBox"

基于此名称,我需要代码

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

推荐答案

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

int total= qty * price;

TotalTextBox.Text = total.ToString();


这篇关于如何计算两个文本框的乘积并打印到第三个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆