Well, you can definately set a form's parent via the API using hwnd,
but that won't give you all of the behaviors you want.
Here's one work-around:
When the .NET form button_click is fired, show a dummy .NET form
modally (ShowDialog). This form should then invoke your VB form. The
dummy form should be made effictively hidden (no titlebar, width and
height of 0 or 1, etc), and the VB form may need to use an API to set
the modal .NET form as a parent so that the VB modal forms stack
correctly on top of the .NET forms.
HTH,
Tom
[quoted text, click to view] Ade wrote:
> I have a .net class that displays a .net form (1), when the user clicks a
> button on the form (1) an event is fired that is captured by a wrapping COM
> dll. The COM DLL instantiates another COM Class that shows a form (2). The
> wrapping COM object is written in VB classic and the called COM object that
> shows the form (2) should show it as application Modal ie myform.Show
> vbModal. The thing is it does not, THE FORM(2) IS shwon for all VB forms as
> modal, but for .net forms the form(1) is left free.
>
> I thought I may be able to set the parent form when showing, I can get the
> form (1) hwnd, but I need a VB form object to pass to COM form (2) .show
> method. Any ideas?
>
> Or is there any other way around this?
> --
> Big thank you for your help.
Thanks TDC,
Any suggestions as to the API function to get it to stack? SetParent()
doesn't seem work because it displays it as MDI style.
Ade
--
Big thank you for your help.
[quoted text, click to view] "TDC" wrote:
> Well, you can definately set a form's parent via the API using hwnd,
> but that won't give you all of the behaviors you want.
>
> Here's one work-around:
>
> When the .NET form button_click is fired, show a dummy .NET form
> modally (ShowDialog). This form should then invoke your VB form. The
> dummy form should be made effictively hidden (no titlebar, width and
> height of 0 or 1, etc), and the VB form may need to use an API to set
> the modal .NET form as a parent so that the VB modal forms stack
> correctly on top of the .NET forms.
>
> HTH,
> Tom
>
>
> Ade wrote:
> > I have a .net class that displays a .net form (1), when the user clicks a
> > button on the form (1) an event is fired that is captured by a wrapping COM
> > dll. The COM DLL instantiates another COM Class that shows a form (2). The
> > wrapping COM object is written in VB classic and the called COM object that
> > shows the form (2) should show it as application Modal ie myform.Show
> > vbModal. The thing is it does not, THE FORM(2) IS shwon for all VB forms as
> > modal, but for .net forms the form(1) is left free.
> >
> > I thought I may be able to set the parent form when showing, I can get the
> > form (1) hwnd, but I need a VB form object to pass to COM form (2) .show
> > method. Any ideas?
> >
> > Or is there any other way around this?
> > --
> > Big thank you for your help.
>
Don't see what you're looking for? Try a search.