加,减两个文本框相减或相乘,然后在另一个文本框中输出该值 [英] Adding subtracting multiplying or dividing two text boxes and outputting the value in another text box
本文介绍了加,减两个文本框相减或相乘,然后在另一个文本框中输出该值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请解决此错误,因为该错误无法将类型int隐式转换为字符串
Please fix this the error is cannot implicitly convert type int to string
private void button1_Click(对象发送者,EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
如果(checkBox1.Checked == true)
{
textBox3.Text = a + b;
}
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
如果(checkBox1.Checked == true)
{
textBox3.Text = a + b;
}
private void button1_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
if (checkBox1.Checked == true)
{
textBox3.Text = a + b;
}
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
if (checkBox1.Checked == true)
{
textBox3.Text = a + b;
}
推荐答案
请解决此错误,因为该错误无法将类型int隐式转换为字符串
Please fix this the error is cannot implicitly convert type int to string
如果(checkBox1.Checked == true)
{
textBox3.Text = a + b;
}
{
textBox3.Text = a + b;
}
if (checkBox1.Checked == true)
{
textBox3.Text = a + b;
}
{
textBox3.Text = a + b;
}
这篇关于加,减两个文本框相减或相乘,然后在另一个文本框中输出该值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文