StrataFrame Forum

Opening mdi child from Browse Dialog

http://forum.strataframe.net/Topic30786.aspx

By Mike Tomlin - 1/6/2012

Hi

From an MDI child form I run a browse dialog from a button click. When the user runs the search the custom information panel of the browse dialog shows a list of related items in a StratListView each one having a link.

What I want to do is click on the link, close the browse and open a new MDI child form showing details relating to that link. As the browse dialog opens as modal I'm struggling to reference the MDI parent properly (relative beginner in C#).

If I was opening a new child mdi from an existing child mdi then something like

MainForm loForm;
loForm = (MainForm)this.ParentForm;
loForm.LaunchDialog(typeof(MyNewDialog));

ought to work. 

What do I need to do to get it to work when running from the info panel of a browse dialog?

Many thanks

Mike


By Ivan George Borges - 1/6/2012

Have you tried passing your BD as a parameter to your newly created form and then trying to close it from there once shown?
By Mike Tomlin - 1/9/2012

Hi Ivan

I hadn't got that far yet. What I am stuck on is how to reference the mdi parent form so I can open a new mdi child form from the browse dialog which is outside the mdi structure - i.e it doesn't have a mdi parent? Have I explained it better Smile
By Ivan George Borges - 1/9/2012

Would you be able to open it just as a normal dialog? Something like:

        '-- Instanciate the new form
        Dim MyChildForm1 As New MyChildForm

        '-- show it as a Dialog
        MyChildForm1.ShowDialog()