plz如何将两个文本框的值乘以第三个文本框 [英] plz how to multiply value of two textboxes into the third text box

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

问题描述

TextBox3.Text=(Convert.ToInt32(TextBox1.Text) * Convert.ToInt32(TextBox2.Text);





此代码生成错误。



plz如何将两个文本框的值乘以第三个文本框



This code is error generate.

plz how to multiply value of two textboxes into the third text box

推荐答案

尝试:

Try:
textBox3.Text = (Convert.ToInt32(textBox1.Text) * Convert.ToInt32(textBox2.Text)).ToString();



C#需要:

1)正确的案例名称 - 区分大小写,所以 TextBox1 不一样textBox1

2)匹配括号!

3)与VB不同,C#不进行隐式类型转换 - 你必须自己更改类型。


C# requires:
1) Correct case names - it is case sensitive so TextBox1 is not the same as textBox1
2) Matched brackets!
3) Unlike VB, C# does not do implicit type conversion - you have to change the type yourself.


这个代码是否构建在第一位?

我在第一个之前注意一个额外的括号 TextBox3.Text = Convert.ToInt32(TextBox1.Text)* Convert.ToInt32(TextBox2.Text); 转换为这行代码。
Is this code building in the first place?
I notice an extra bracket TextBox3.Text=(Convert.ToInt32(TextBox1.Text)*Convert.ToInt32(TextBox2.Text); before the first Convert in this line of code.


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

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