在sum文本框中添加两个文本框 [英] Adding two text box to sum text box
本文介绍了在sum文本框中添加两个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
有人可以帮我添加两个文本框而无需点击按钮。
例如:
Hello,
Can someone help me adding two text box without clicking a button.
example:
textbox1 = (1)
textbox2 =(50)
textboxsum = (51) <--- automated sum from textbox1 and textbox2
i已经在textbox1和textbox2上有值,我想在textboxsum上自动计算文本框的两个值。
textbox1和text2值来自我的数据库。
提前谢谢
我尝试了什么:
注意:
textchange事件有效但我需要手动输入文本框上的值以获得总和。
i have already values on textbox1 and textbox2, I want the two values of textbox automatically computed on textboxsum.
textbox1 and text2 values came from my database.
thanks in advance
What I have tried:
Note:
textchange event works but i need to manually input the values on text box in order to get the sum.
推荐答案
我会实现TextChange - 像textbox1和textbox2这样的事件:< br $> b $ b
I would implement the TextChange-Event on the both of the textbox1 and textbox2 like this:
Try
textboxsum.Text = Convert.toInt32(textbox1.Text) + Convert.toInt32(textbox2.Text)
Catch ...
这篇关于在sum文本框中添加两个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文