Re: Issues with displaying a .Net Form as Child of a MDI Form in VB6 Application



"Splat" <Splat021@xxxxxxxxx> wrote in message
news:1129931827.766206.65770@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi everyone,
>
> I am calling a .Net form from a VB6 MDI application, and want the .Net
> form to behave exactly like VB6 MDI child form.

You'll probably fail miserably <g> VB6 MDI Parents refuse to adopt children.
Period.

> After doing some more research on the net, I could display the .net
> form as child of the VB6 MDI form using some winapi functions like
> SetParent().

SetParent won't give you the MDI Child form functionality.

> After calling SetParent() the .Net form appears within the MDI form,
> but the forms Tab Keys and Arrow Keys do not work. That is, I am able
> to type values in to the textbox but cant move to the next textbox
> using the Tab key

That's one of the side effects of SetParent.

> Does anybody know about a work-around for this?
> Or, Am I using the right approach to make a .Net form behave as VB6 MDI
> Child form in a VB6 application?

MDI Parent forms are very stubborn. They only treat MDI Child forms that are
part of the same project as children. There's nothing that can be done about
that except.....

The usual way people do this kind of thing is add a real MDI Child form to
the project and then load a custom OCX that represents a form onto that real
child. I'm not sure about .Net but in VB, this method works well because
Usercontrols are really just a specialized form. All code you can place in a
form can work in a VB6 OCX (more or less... there's no Form_Load or similar
in an OCX but it has equivalent events)

So, if you can convert that DLL into a Usercontrol that VB can load at
runtime, and load that onto a real child form, you'll be set.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..


.



Relevant Pages

  • RE: Mdi Icon Position in MenuStrip
    ... you'd like to show the icon of a maximized MDI ... child form immediately left of the control box buttons(Minimize, Maximize, ... Maximize/Resore menu item ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: My.Application.OpenForms
    ... Sorry you're missing the VB6 IDE; ... Have you solved the problem of sizing a child form to fit the MDI ... 'enable application framework' checkbox is unchecked. ...
    (microsoft.public.dotnet.languages.vb)
  • MDI: A solution for Nilling Child form pointers
    ... suppose you have a number of MDIchild windows that are created and ... Since various of the MDI ... my solution to this has been to equip each child form ... OnDestroy handler, and then propagated to the MDI main form as follows: ...
    (borland.public.delphi.language.objectpascal)
  • Re: Clicking a button and pressing Enter key act different in MDI
    ... This event "Occurs when a multiple document interface (MDI) child form is ... child form visibility in Button click event, not in MdiChildActivate event. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Issues with displaying a .Net Form as Child of a MDI Form in VB6 Application
    ... I agree that the SetParent() ... > You'll probably fail miserably VB6 MDI Parents refuse to adopt children. ... > SetParent won't give you the MDI Child form functionality. ...
    (microsoft.public.vb.winapi)

Quantcast