本文介绍了计算值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该怎么做:

textbox1 + textbox2 = textbox3

(给出两个字段,自动计算最后一个字段。)


-

通过DotNetMonster.com发布消息


how can i do this:
textbox1 + textbox2 = textbox3

(the two fields are given and the last field is automatically calculated.)

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200803/1

推荐答案



你的意思是? :


textbox3.text = textbox1.text + textbox2.text

但要小心,textbox包含字符串,输入必须包含

数字不得异常。

You mean? :

textbox3.text = textbox1.text + textbox2.text

But be careful textbox holds strings, that your input must consist of
numbers not to get an exception.




你的意思是? :


textbox3.text = textbox1.text + textbox2.text

但要小心,textbox包含字符串,输入必须包含

数字不会出现异常。


You mean? :

textbox3.text = textbox1.text + textbox2.text

But be careful textbox holds strings, that your input must consist of
numbers not to get an exception.



实际上,这会连接字符串。如果Textbox1.text =" 4"和

textbox2.text =" 5"然后textbox3.text将被设置为45。如果Textbox1.text

=" Blue"和textbox2.text =" green",然后textbox3.text将设置为

" Bluegreen"。

Actually, this concatenates the strings. If Textbox1.text = "4" and
textbox2.text = "5" then textbox3.text will be set to "45". If Textbox1.text
= "Blue" and textbox2.text = "green", then textbox3.text will be set to
"Bluegreen".



这篇关于计算值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 19:34