Category Archive for: Building AdiveX Controls

Interacting with the Container

Activex controls are meant to be used as building blocks in application development. As such they are sited on Forms or other controls that can act as containers. As an Activex control designer you should be able to access the properties of a control’s container and adjust the control’s appearance according to the properties of the container. You…

Read More →

Using the Custom Control in Other Projects

By adding the test project to the custom control project we were able to design and test the control in the same environment. A great help indeed but the custom control can’t be used in other projects. If you start another instance of Visual Basic and attempt to add your custom control to the toolbox you won’t see…

Read More →

Enumerated Properties

If you switch to the test Form and exercise the new control you’ll see that it does n quite behave like the standard controls. The custom properties on the Properties window can be set to any value. We need to add some code that will display only valid values for the Text Alignment and Effect properties and limit…

Read More →

The WriteProperty Method

This method has the following syntax: Write Property property Name value default Value The property Name variable is the name of the property (Effect for instance) value can be a literal (such as 1 or “some sizzling effect”) but is nearly always the name of the private variable that holds the property value and default Value is the…

Read More →

setting and Reading PrOperty Values

Next you see the number of subroutines two for each property. The caption property Procedures Public Property Get Caption() As String Caption – m_Caption End Property Public Property let Caption(ByVal New_Caption As String) nLCaption – New_Caption PropertyChanged ‘Caption’ End Property Each property is defined by two Public procedures: • Property Let • Property Get The Property…

Read More →

The Skeleton of the AdiveX Control

Before adding the custom code, you must understand what the wizard did for you. Switch to the Project Explorer window and double-click the name of the control to open it in design mode. Then, double-click the User Control to open the code pane  and see the lines inserted by the wizard The ActiveX Control Private m_Caption As String Pr~vate…

Read More →

Creating Custom Interface Members

In this window you add the properties events and methods that are unique to your custom control. Follow these steps: 1. Click the New button to display the Add Custom Member dialog box.   2. In the Name box, enter Caption (which is the name of a property)and select the Property radio button. 3. Click OK. The…

Read More →

The FLEXLabel Controls Specifications

The FLEX Label control displays a caption like the standard Label control, so it must provide the Caption and Font properties which let the developer determine the text and its appearance: In addition the FLEX Label control can align its caption The FLEX Label control displays a caption like the standard Label control so it must provide the Caption…

Read More →

Building the FLEXlabel Control

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…

Read More →

The FLEXLabel Custom Control

Well start our exploration of custom activex controls with ‘a simple example. The first control we’ll develop in this chapter is the FlEXLabel control which is an . enhanced Label control and is shown in Figure 16.1.It provides all the members of the Label control plus a few highly desirable hew features such as the ability to align the text…

Read More →

Back to Top