What to do? Maybe some class need to add?
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication5 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { textBox1.Text = textBox1.Text += "1"; } private void button2_Click(object sender, EventArgs e) { textBox2.Text = textBox2.Text += "9"; } private void button3_Click(object sender, EventArgs e) { int a = Convert::ToInt32(this->textBox1.Text->Text); int b = Convert::ToInt32(this->textBox2.Text->Text); textBox3.Text = a+b; } } }
Added.
After changing the code to (textBox3.Text = Convert::ToInt32(textBox1.Text)) + (Convert::ToInt32(textBox2.Text));
errors became 2. Only one mistake this:
The namespace qualifier "::" is always resolved to a type or namespace, which in this case is invalid. Consider using ".".
At Visual Studio 2010, I selected the very first item - Windows Forms = Visual C # Application.
textBox1.Text = textBox1.Text += "1";
equivalent totextBox1.Text += "1";
on the topic: the class Convert is included in the System space, so in using `s nothing needs to be added and on the ideaConvert::ToInt32(textBox2.Text);
should work properly - Specter