Visual Basic Concepts
ActiveX controls typically have an About "property" at the top of the Properties window, with an ellipsis button. Clicking the button shows an About box identifying the control and the software vendor that created it.
Visual Basic makes it easy to provide such About boxes. You can have separate About boxes for each control in your control component (.ocx file), or one About box that all the controls in the component share.
To add an About box to a control component
Public Sub ShowAboutBox()
dlgAbout.Show vbModal
Unload dlgAbout
Set dlgAbout = Nothing
End Sub
Important Unloading the About box and setting it to Nothing frees the memory it was using. This is a courtesy to the user of your controls.
Note The name of the About box form and the method that shows it can be anything you like. The procedure above used dlgAbout
and ShowAboutBox
for purposes of illustration only.
If you wish to have separate About boxes for each control, simply create additional forms, and show a different form in each control's ShowAboutBox method.
Of course, each form you add to the project increases its size. You can get the same effect with the single dlgAbout form by giving it a property named, let us say, ControlID. This property identifies which control dlgAbout is being shown for. In each control's ShowAboutBox method, set the ControlID property before showing dlgAbout. Place code in the Load event of dlgAbout to change the text and bitmaps on the About box appropriately.
For More Information Adding properties and methods to forms is discussed in "Programming with Objects," in the Visual Basic Programmer's Guide.