Home All Groups Group Topic Archive Search About

Using .NET user controls into VB6

Author
20 Jun 2006 8:31 PM
emferrari
Hi

I just developed a small form in C# to use inside of my old VB6
programs.
My first step was to build a new WindowsControlLibrary project and add
the usercontrol to it.
It compiled, a DLL was built, and by setting the "Register for COM
Interop" to TRUE a .tlb file was also built. I added this tlb file as a
reference into VB6.

Now I put a menu item and in the code for the menu item the following:

Dim myControl As MyControl.UserControl1

How do I show the control to the user now? Any ideas? Sorry if this
sounds stupid.

Thanks!

Eduardo

Author
20 Jun 2006 8:55 PM
Herfried K. Wagner [MVP]
<emferr***@gmail.com> schrieb:
Show quoteHide quote
> I just developed a small form in C# to use inside of my old VB6
> programs.
> My first step was to build a new WindowsControlLibrary project and add
> the usercontrol to it.
> It compiled, a DLL was built, and by setting the "Register for COM
> Interop" to TRUE a .tlb file was also built. I added this tlb file as a
> reference into VB6.
>
> Now I put a menu item and in the code for the menu item the following:
>
> Dim myControl As MyControl.UserControl1
>
> How do I show the control to the user now? Any ideas? Sorry if this
> sounds stupid.

This scenario is not supported.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
21 Jun 2006 12:42 PM
emferrari
How about this:

I write a C# application and call it from VB6 as a normal executable.
There is SOME WAY that I can have access to the controls of the screen,
such as, textbox, combobox, buttons, etc. If not, there is a way to
create a collection of these objects and pass as a parameter to the
program ?

Thanks!

Eduardo

Herfried K. Wagner [MVP] wrote:
Show quoteHide quote
> <emferr***@gmail.com> schrieb:
> > I just developed a small form in C# to use inside of my old VB6
> > programs.
> > My first step was to build a new WindowsControlLibrary project and add
> > the usercontrol to it.
> > It compiled, a DLL was built, and by setting the "Register for COM
> > Interop" to TRUE a .tlb file was also built. I added this tlb file as a
> > reference into VB6.
> >
> > Now I put a menu item and in the code for the menu item the following:
> >
> > Dim myControl As MyControl.UserControl1
> >
> > How do I show the control to the user now? Any ideas? Sorry if this
> > sounds stupid.
>
> This scenario is not supported.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>