Ok, i found some kind of solution myself:
First Create a COM Class with DOT NET.
Menu "Project" - "AddNew Item" - Com Class.
But the Code from there into your UserControl
It look something like this the:
<ComClass(UserControl1.ClassId, UserControl1.InterfaceId,
UserControl1.EventsId)> _
Public Class UserControl1
Inherits System.Windows.Forms.UserControl
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "4E194D65-C09C-4378-B47F-CAAF521EB8EC"
Public Const InterfaceId As String =
"F9913483-3444-4989-A4D1-F1D4D23955BA"
Public Const EventsId As String = "F05903BF-31A7-47F6-AF5F-67C230D1F172"
#End Region
Windows Form Designer generated code
Public Sub Test()
End Sub
End Class
If you compile the whole thing you there is a *.TLB File created.
Now start VB6:
Make a reference to the TLB File.
Then in the VB 6 User Control you can load your DOT NET Control Dynamicly:
Dim vlob_UserCtrl As Object
Set vlob_UserCtrl = Controls.Add("ClassLibrary5.UserControl1", "HeadCtrl")
vlob_UserCtrl.Left = 0
vlob_UserCtrl.Top = 0
vlob_UserCtrl.ZOrder 0
vlob_UserCtrl.Visible = True
ClassLibrary5.UserControl1 = Namespace and Controlname of the DOT Net
Control
"Captain Chaos" <no****@nospam.com> schrieb im Newsbeitrag
news:bt*************@news.t-online.com...
Hello
Is it Possible to build an ActiveX Control with NET ?
I want to take a NET UserControl and use it with VB6.
I found a solution how to embbed a NET UserControl into
a WebPage (Like it was possible with ActiveX Control)
http://www.vbdotnetheaven.com/Code/Jun2003/2067.asp
Maybe that is the halve way.
Any Idea ?