0

Hi,

I created 2 window form using visual C++, I am trying to display the string typed by user in second window form's textbox.

Here is what i wrote, but the code is not working:

Form1.h

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
tabPage1->Text=Form2().textBox1->Text;
}

2
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by mitrmkar
0

System::Windows::Forms:: DialogResult dr;
dr = form2().ShowDialog();
if(dr==System::Windows::Forms:: DialogResult::OK )
{
String^ strmsg=form2().textBox1->Text;
MessageBox:: Show(strmsg);
}

I also tried this method but message box show nothing...why?

0

How come nobody have comment on this? I need this urgently..Pls help me....

Million thanks in advance.

0

The code looks strange (I'm in a hurry now and can't explain in details),
anyway try something like;

form2 frm;
frm.ShowDialog();
MessageBox:: Show(frm.textBox1->Text);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.