Category Archive for: Building AdiveX Controls

The User Controls Lost Focus Event Handler

Private Sub Textl_LostFocus() If Len(Trim(Textl.Text)) =·0 And m_Mandatory = Required Then TexU.BackColor = m_MandatoryColor Else Textl.BackColor – leaveFocusColor End If End Sub NOTE Notice that the code isn’t raising the Lost Focus event. Although the control’s behavior when it loses the focus is determined by its code you may still want to be able to program the…

Read More →

An Enhanced TextBox Control

The c text Box control is a custom ActiveX control that enhances the operation of the standard TextBox control. It’s a simple control (it inherits all of the TextBox control’s  functionality) but I found it very useful in designing data-entry applications. As you will see the enhancements are quite simple and really trivial to implement.  Most of…

Read More →

Enhancing Existing Controls

You can also .develop custom ActiveX controls that enhance existing controls. There’s not a single user who wouldn’t like to add “new” features to existing controls. Many programmers add new features to standard ActiveX controls with the appropriate code from within their applications. A shortcoming of the Combo List control for instance, is that any new entries added…

Read More →

Updating the Display

Now we can write the code that updates the display and raises the Tune Out event. The code we develop in this section has nothing to do with ActiveX control development. It’s the type of code you write to implement an alarm as a standalone application. TIP If you’re not quite accustomed to the ActiveX development environment yet…

Read More →

Implementing the Controls Members

Now we are ready to implement the control’s properties, its methods, and its event. Let’s start with the properties. You have seen how to add properties to a control with the ActiveX Control Interface Wizard and how to do it manually. Now let’s look at one more tool. We will 40 something similar with the Wizard but this…

Read More →

The Alarm Control’s Interface

The Alarm control has two custom properties: • Count Down • Alarm time Alarm time is the time when the alarm goes off expressed in  M/PM format. Count Down is a True/False property that determines what’s displayed on the control. If Count Down is True the alarm displays the time remaining. If you set the alarm to go…

Read More →

Initializing the Control al’d Its Properties

You can use two events to maintain the control  and Init Properties. The Init Properties event is the place to assign  ital values to the various properties. The ActiveX User Interface Wizard does it so well for us. The Initialize event can be used to enter initialization code that doesn’t involve properties. If you attempt to set a…

Read More →

Building a Generic Control

In the first section of this chapter, you learned how to b Wilde ActivX controls with the ActiveX User Interface Wizard. Eve though the Wizard to  care of man. details for you and constructed a functional control you had to  ow a  about a control’s modes of operation in order to attach the desired type of fl…

Read More →

Editing a Property Page

Run the test project and check out the operation of the Property Pages generated by the Wizard: This is a good point to add a few more controls on the Text Properties tab which will allow developers to set the other custom properties. The finished Property Page should look like the one shown in Figure 16.12 The Property…

Read More →

Selecting the Property Pages

In this window you select the Property Pages for your control. This window contains some (or all) of the standard Property Pages: • Standard Font which allows you to set the font • Standard Picture which allows you to set Picture properties • Standard Color which allows you to set color For our control’s Property Pages…

Read More →

Back to Top