We’ll get to the implementation of the control shortly out first I want to discuss . the benefits of building an activex control. Some of you may be.wondering Why . bother with an Active control? I have the code to display 3D text on my Forms and align it any way.I like..If I want to. I can modify the code to work with a Picture- Box control which I can place anywhere on my Forms
Indeed a custom control such as the FLEX Label control is nothing more than an application wrapped in a different package. There are benefits in packaging some applications as ActiveX controls and here are the most convincing ones:
• The control’s code won’t interfere with the application code. Your application Will not even be aware of the controls code.
• You can change the text alignment and the special effect in the Properties window. No need to edit the code that displays ‘the text. In addition you can edit the control visually and see the effects of the changes without executing the project.
• The control can cover only part of the Form. Moreover you can place multiple controls with different captions on the same Form.
• Finally you can distribute the control easily and other developers can use it without touching its code.
The first step in designing a custom control is to design the control’s interface: what it will look like when placed on a Form (its visible interface) and how developers can access this functionality through its members (the programmable interface). Sure you’ve heard the same advice over and over and many of you still start coding an application without spending much. time designing it. In the real
world especially if you are not a member of programming team people design’ as they code (or the other way around).
The situation is quite different with ActiveX controls. Your custom control must provide a number of properties, which will be displayed automatically in the Properties window. The developer should be able to adjust every aspect of the control’s appearance by manipulating the settings of these properties. In addition developers
expect to see the standard properties shared by most standard controls (such as the background color the text’s font, and so on). You must carefully design the methods so that they expose all the functionality of the control-that should be accessed roll with in the application’s code, and the methods shouldn’t overlap. F bally you must provide the events necessary for the control to react to!external events. You can start coding other types of applications without much design but ActiveX controls (and database applications) require thoughtful preparation. don’t start coding a-custom control unless you have formulated a very clear idea of what the control will do and how it will be used by developer at design time