Consuming visual managed controls from unmanaged apps (i.e. VB6)

  • Thread starter Thread starter Brett
  • Start date Start date
B

Brett

I have developed a managed (VB.NET) usercontrol and have consumed it in VB6
with limited success. I'm not sure I'm going about it the correct way, so I
wanted to try to get a consensus from others. Basically I created the
usercontrol and exposed it to COM using the standard (I think) methods.
Without boring everyone with a lot of details, what I want to be able to do
is add that component to the toolbox in VB6 and use it on VB6 forms. The
only way I can get it on the form right now is by dynamically adding it at
Form_Load with Me.Controls.Add <prog_id>, <name>. It shows on the form but
the visual behavior of the control is odd (i.e. its border disappears when
the control loses focus, comes back when the control gains focus, focus can
only be regained with a double-click, etc.)

I guess my question is, has anyone done this successfully before. If so can
you point me to any resources to get me there?

Thanks in advance.
Brett
 
Brett said:
I have developed a managed (VB.NET) usercontrol and have consumed it in VB6
with limited success. I'm not sure I'm going about it the correct way, so
I wanted to try to get a consensus from others. Basically I created the
usercontrol and exposed it to COM using the standard (I think) methods.
Without boring everyone with a lot of details, what I want to be able to do
is add that component to the toolbox in VB6 and use it on VB6 forms.

That's not supported. In other words, you cannot use VB6 as
host-environment for .NET Windows Forms controls.
 
Back
Top