如何添加多个文本框...? [英] How to add multiple textboxs...?

查看:52
本文介绍了如何添加多个文本框...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个文本框.
我还计算了文本框的值...
那么如何编写代码...
请帮助...

i hav multiple textboxs.
i calculate the textbox values in addition...
so how to write code...
pls help...

推荐答案

示例,如果您有3个文本框,则可以将所有3个文本框添加为:

Example, if you have 3 text boxes, you can add all 3 as:

totalValue = int.Parse(txtBox1.Text) + int.Parse(txtBox2.Text) + int.Parse(txtBox3.Text); 


decimal num1, num2, num3, total;
num1 = Convert.ToDecimal(TextBox1.Text);
num2 = Convert.ToDecimal(TextBox2.Text);
num3 = Convert.ToDecimal(TextBox3.Text);
total = num1 + num2 + num3;


这篇关于如何添加多个文本框...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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