Re: Issues with displaying a .Net Form as Child of a MDI Form in VB6 Application
- From: "Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 21 Oct 2005 15:14:00 -0700
"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..
.
- Follow-Ups:
- References:
- Prev by Date: Re: Issues with displaying a .Net Form as Child of a MDI Form in VB6 Application
- Next by Date: Re: Issues with displaying a .Net Form as Child of a MDI Form in VB6 Application
- Previous by thread: Re: Issues with displaying a .Net Form as Child of a MDI Form in VB6 Application
- Next by thread: Re: Issues with displaying a .Net Form as Child of a MDI Form in VB6 Application
- Index(es):
Relevant Pages
|