3,978 questions
TextBox is a control and cannot match String^. I suggest that you could try the following code.
String^ in1;
System::Windows::Forms::TextBox^ textBox1;
textBox1->Text = in1;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm using Visual C++ 2017 with CLR to make a windows program.
Here is the code with the errors:
String^ in1;
System::Windows::Forms::TextBox^ textBox1 = in1;
String^ in2;
System::Windows::Forms::TextBox^ textBox2 = in2;
String^ in3;
System::Windows::Forms::TextBox^ textBox3 = in3;
String^ in4;
System::Windows::Forms::TextBox^ textBox4 = in4;
String^ in5;
System::Windows::Forms::TextBox^ textBox5 = in5;
Here is what the errors look like in the compiler:
Error (active) E0144 a value of type "System::String ^" cannot be used to initialize an entity of type "System::Windows::Forms::TextBox ^" QMB
Error C2440 'initializing': cannot convert from 'System::String ^' to 'System::Windows::Forms::TextBox ^' QMB
TextBox is a control and cannot match String^. I suggest that you could try the following code.
String^ in1;
System::Windows::Forms::TextBox^ textBox1;
textBox1->Text = in1;