vb logo

 

Visual Basic Books
Home
Visual Basic Beginner Books
Visual Basic Database Books
Visual Basic ActiveX Books
Visual Basic Advanced Books
VB Internet Programming Books

Resources
Free Online Visual Basic Courses
Visual Basic Links
Add a Link
Subscribe to Mailing List

Visual Basic Books

Programming Components with Microsoft Visual Basic 6.0

Creating
ActiveX Controls

  1. Close the UserControl designer.
  2. Now place the new control on Form1.
  3. In the Project window, double-click UserControl1 to reopen the UserControl designer.
  4. Double-click the UserControl designer to open the Code window.
  5. Code the following event procedures. You can use the Procedure box to select the event procedures and then add the message box code (shown in bold).

Private Sub UserControl_Initialize()
MsgBox "Initialize"
End Sub

Private Sub UserControl_InitProperties()
MsgBox "InitProperties"
End Sub

Private Sub UserControl_ReadProperties(PropBag As _
PropertyBag)
MsgBox "ReadProperties"
End Sub

Private Sub UserControl_WriteProperties(PropBag As _
PropertyBag)
MsgBox "WriteProperties"
End Sub

Private Sub UserControl_Terminate()
MsgBox "Terminate"
End Sub

Private Sub UserControl_Resize()
MsgBox "Resize " & ScaleWidth & ", " & ScaleHeight
End Sub

Private Sub UserControl_Show()
MsgBox "Show"
End Sub

  1. Close the Code window, and then close the UserControl designer. Note that the controlís icon in the toolbox has become enabled. This indicates that the control has been placed in run mode.

Note that the message boxes appear in the following order:

Initialize
Resize 1524, 1284
ReadProperties
Show

(Your resize values will reflect the size of your control.)

next page....
Email us your comments:mail
Fax: 1(916)404-7719
©1999 Valassis Enterprises. All rights reserved.