Form12.cpp
.\Form12.cpp(9) : error C2065: 'textBox1' : undeclared identifier
.\Form12.cpp(9) : error C2227: left of '->Text' must point to class/struct/union/generic type
type is ''unknown-type''
(I have another basic Form in VC++ 2005 too just for testing purposes).
Basically, I tried TextBox1->Text (which was not how it is declared but thought, why not, eh?) and also tried the declared version and neither work!
<br />
<br />
#include "stdafx.h"<br />
#include "Form1.h"<br />
<br />
using namespace Form12;<br />
System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {<br />
<br />
textBox1->Text = "hello";<br />
<br />
}<br />
If I reference the textBox1->Text using;
this->textBox1->Text = "hleoo!";
in the Form12.h header file method it works. But, writing code in header files is stupid. I want it write in Main.cpp