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

Steps to Creating an ActiveX Control that Expose Properties

To implement your own ActiveX control, you must take the following basic steps:

  • Put a UserControl container into your application. This object is implemented in its own separate file similar to a Form. The UserControl provides the basis for the control.

  • If you decide to implement user-drawn features in your control, you must plan and implement those raphic features, putting code in the appropriate event procedures.

  • Create custom methods and events in the UserControl as you would in a Class Module.

  • Create custom properties in the UserControl as you would in a Class Module, remembering to make extra provision for property persistence.

  • If you decide to implement constituent controls, then you must place any constituent controls that you will be using on the UserControl's surface and implement their delegated methods, delegated events, and delegated properties as well.

  • Put additional code in UserControl event procedures so that you initialize your control's properties appropriately and cause them to persist.

The following sections descripbes the above metioned steps in details

  1. The UserControl Object

  2. Implementing User-Drawn Graphic Features

  3. Implementing Custom Methods

  4. Implementing Custom Events

  5. Implementing Custom Properties
    Defining Properties with Get/Let/Set Procedures or Public Variables

  6. 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

  7. Implementing Constituent Controls


<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved