Using C++/CLI--
Is there a good way to return a value (not a DialogResult) from a form shown as a dialog?

I plan to use Invoke on a method to update the previous form from within the dialog, if not.

I also would like to thank the fine members of Daniweb for being so helpful, as always.

Not sure what your asking. You have Form1 that invokes Form2 and you want Form2 to return something to Form1?

Here is an example where Form1 copies the text from Form2 after Form2 closes. In Form2.h I added a public method that return the String from its textBox1 text control. Similar technique can be used for all of the controls on Form2.


        String^ GetTextBoxString() { return textBox1->Text; }

Form1.h This method is envoked when a button control is clicked.

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
                 Form2^ f2 = gcnew Form2;
                 this->textBox1->Text = f2->GetTextBoxString();