Hi,

I have 7 forms in my project. Form 6 has a text box, I wish for the text entered in Form 6 to be passed to a label in Form 7. I am new to C++ and would really appreciate any advice. I have posted the code I am trying to work with but i keep getting error C2248. Please Help!! Thanks.
Code:
public ref class Form6 : public System::Windows::Forms::Form
{
public:String^str1;

public: 

Form6(void)


{

InitializeComponent();
//
//TODO: Add the constructor code here
//
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {

Application::Exit();
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {

Application::Exit();
}
private: System::Void label2_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {

this->textBox2->Text = this->textBox1->Text;
this->textBox1->Text = "";
this->textBox1->Text = "Saved";
} 
private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
}
public: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
str1 = this->textBox2->text;
Form6::Hide();
Form7 myForm;
if(myForm.ShowDialog() == System::Windows::Forms::DialogResult::OK)

{
//Do stuff
}
}
private: System::Void Form6_Load(System::Object^ sender, System::EventArgs^ e) {
str1 = "str1default";
}
private: System::Void textBox2_TextChanged(System::Object^ sender, System::EventArgs^ e) {
str1=textBox2->Text;
}
};
}

Last edited by shabbir; 9Feb2009 at 09:05.. Reason: Code blocks