VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 13

Creating ActiveX Controls in Visual Basic 6 (VB6)

( Contents )

This chapter discusses a very important part of Microsoft's strategy for VB development—the ability to create ActiveX controls. Since Version 5 of VB, the VB programmer is not limited to using standard VB controls provided by Microsoft or custom controls provided by Microsoft and third parties.

Now VB developers can create their own ActiveX controls, either as an integral part of a larger VB project or as a standalone reusable component in an .OCX file. The information in this chapter provides a basic acquaintance of VB6 ActiveX control programming.


  1. ActiveX Controls as ActiveX Components
    Creating ActiveX Controls from Constituent Controls
    Creating User-Drawn ActiveX Controls

  2. The Lifetime of an ActiveX Control
    Control Authors and Developers

  3. Special Considerations for ActiveX Control Development

  4. Steps to Creating an ActiveX Control that Expose Properties
    The UserControl Object
          Giving Your Control a Custom Bitmap
          Accessing Ready-Made Control Features with the UserControl's Extender Object
          Getting Information About Your Control's Environment with the Ambient Object and the AmbientChanged Event
          Comparison of the Ambient and Extender Objects
    Implementing User-Drawn Graphic Features
    Implementing Custom Methods
    Implementing Custom Events
    Implementing Custom Properties
          Defining Properties with Get/Let/Set Procedures or Public Variables
    Implementing Property Persistence
          Using the InitProperties Event to Set Default Starting Property Values
          The InitProperties Event Versus the Initialize Event
          Using the Property Bag to Store Property Values
          Using ReadProperties and WriteProperties Events and Corresponding Methods to Maintain Persistent Properties
          Storing Persistent Property Values with the WriteProperties Event and the WriteProperty Method
          Calling the PropertyChanged Method to Trigger WriteProperties
          Retrieving Persistent Property Values with the ReadProperties Event and the ReadProperty Method
    Implementing Constituent Controls
    Implementing Delegated Methods
    Implementing Delegated Events
    Implementing Delegated Properties

  5. Creating Data-Aware ActiveX Controls
    Enabling the Data-Binding Capabilities of an ActiveX Control
    Creating an ActiveX Control that Is a Data Source

  6. Create and Enable Property Pages for ActiveX Controls

    Creating the PropertyPage Object's Visual Interface
    Determining Which Controls Are Selected for Editing With the SelectedControls Collection
    Using the SelectionChanged Event to Detect When the Developer Begins to Edit Properties
    Flagging Property Changes With the Changed Property
    Saving Property Changes With the ApplyChanges Event
    Connecting a Custom Control to a Property Page
    Connecting a Single Complex Property to a Property Page
    Detecting Which Complex Property Is Being Edited With the EditProperty Event
    Connecting a Property to a Standard VB Property Page

  7. Testing and Debugging Your ActiveX Control
    Testing Your ActiveX Control With Existing Container Applications
    Testing and Debugging Your ActiveX Control in a Test Project
    What to Look for When Testing Your ActiveX Control


Get Started >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved