Help for CLR->Windows form App in C++ windows visual studio 2008

Hi, so I've currently trying to make a project where I can open an other windows form application from a menu strip.

I've been told to use this: About ^ form_about = gcnew About;
form_about->ShowDialog(this);

but I've got no idea what to do next. Also, my filter doesn't seem for OpenfileDialog. Here's what I do: Openfiledialog->Filter = Image|*.jpg;

When I try to open a music file to check if it filters, it just says ''error'' and gives me the option to quit, continue or show details.

Try this:

Form1.h or whatever your mainform is called
1
2
3
4
5
System::Void aboutToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
{
   About^ about_form = gcnew About();
   about_form->ShowDialog(this);
}


in About.h or whatever your aboutform is called
1
2
3
4
5
6
7
System::Void About_Load(System::Object^  sender, System::EventArgs^  e) 
{
   OpenFileDialog ^ ofd = gcnew OpenFileDialog();
   ofd->Filter = "Wave files (*.wav)|*.wav|Mp3 files (*.mp3)|*.mp3";
   if (ofd->ShowDialog(this) == Windows::Forms::DialogResult::OK)
      MessageBox::Show(ofd->FileName);
}
I have put the code for : About^ about_form = gcnew About();
about_form->ShowDialog(this);

but I don't know how to bind it to the other form and I don't know where to create the new form so it opens a new window when I press the menu button. Gonna test the filter later though. Thanks for the reply.
I assume you have a main form with a menu or is it just a button? Anyway when you double click it VS will create an event handler. In this handler you create and show the second form as I showed above.
In the main form you also need to include About.h or however the second form is called.
Topic archived. No new replies allowed.