How to Create an ActiveX DLL in Visual Basic 2005
- 1). Click "File > New > New Project," then select "Visual Basic Projects" from the left menu, and then "Class Library" from the right window.
- 2). Right click the name of your new project in the navigation pane, and click "Add > User Control."
- 3). Drag a textbox control from the toolbox palette, onto the user control you just added. Rename the textbox "txtUserText".
- 4). Double-click the gray area of the user control to show the code editor.
- 5). Copy and paste the following into the top of the control class:
Public Property UserText() As [String]
Get
Return mStr_UserText
End Get
Set
mStr_UserText = value
'Update the text box control value also.
txtUserText.Text = value
End Set
End Property - 6). Copy and paste the following above the control class:
Public Interface AxMyControl
Property UserText() As [String]
End Interface - 7). Add the following code to the line immediately below the class declaration for your control:
Inherits System.Windows.Forms.UserControl
Inherits AxMyControl - 8). Build your project by clicking "Project > Build" to generate the ActiveX DLL, ready to put into your website.
Source...