views:

399

answers:

2

I am doing some maintenance on a VB6 Windows application. I have a .Net custom control component that I would like to use on a VB6 form. Is this possible? I know how to access non-visual .Net components from VB6 by generating a COM type library for the .Net DLL, but can a .Net custom control be used like a .OCX from VB6? If so, how is the control instantiated in VB6, added to the form, etc.

Thanks in advance for any replies.

+2  A: 

This will lead you step by step through the process.

http://www.codeproject.com/KB/vb-interop/UsingDotNETControlsInVB6.aspx

It is not a perfect fit so you will have to explore how badly the limitations effect you.

RS Conley
+3  A: 

The Interop Forms toolkit will give you what you need:

http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx

It lets you create UserControls in VB.net which you can then add to VB6. It also lets you display .net forms from your VB6 code.

I've used it successfully to give my old VB6 code the .net toolbars - much nicer!

Alex Warren