In addition to the VBX/OCX controls supplied with Visual Basic, there is a wealth of controls available from third-party vendors. This chapter will cover some of the VBX/OCX controls that are available from third-party vendors.
Third-party custom controls have been available since the introduction of Visual Basic Version 1.0. There are currently hundreds of controls available that perform almost any function that you could imagine. In this chapter, we will look at some of the
commercial products available from Crescent SoftWare, Sheridan SoftWare, Apex SoftWare, Visual Components, and a public domain custom control. The current release of Visual Basic (4.0) supports three types of custom controls—16-Bit VBX, 16-Bit OCX,
and 32-Bit OCX. The professional edition of Visual Basic, contains custom controls that have been licensed to Microsoft by a variety of third-party control vendors. The vendors and the controls provided in the professional edition are as follows:
Data Bound Grid—supplied by Apex
Crystal Report Control—supplied by Crystal Reports
Animated Button Control—supplied by Desaware SoftWare
Communications Control—supplied by Crescent SoftWare
Key State Control—supplied by MicroHelp
Gauge Control—supplied by MicroHelp
3D Controls—supplied by Sheridan SoftWare
Tab Control—supplied by Sheridan SoftWare
Graph control—supplied by Bits per Second
Spin Button—supplied by Outrider systems
For the most part, the controls that are supplied with Visual Basic can be used in order to emulate the functionality contained in most of the third-party custom controls. You would, however, need to design this functionality for each application that
would use this feature. An example of this would be a ToolBar. While it is possible to design a ToolBar using a Picture control, command buttons, and bitmaps, you would have to perform this step for each project that needed a ToolBar. If you had a ToolBar
custom control, you would simply add the control to your project, make a few property changes and that would be it. This is a simple example. The following example will help to illustrate an area where a custom control can be used to a greater advantage.
You would like all the text in a TextBox to be selected when the user accesses the field. In order to perform this task in Visual Basic, you would need to add a GETSELTEXT statement to each of the text boxes GotFocus event. Alternatively, you may use a
third-party custom control that contains a property that would allow this to be done automatically for you.
No matter which version of Visual Basic you are using, the best method available to further enhance your applications is through the use of third-party controls. Third-party custom controls are available for simple controls such as a replaceable text
boxes, with additional properties right up to full-fledged spreadsheet type of controls.
During the discussion of custom controls, no mention will be made of standard Visual Basic properties or events that are supported by the controls. Most of the custom controls listed here support all of the standard Visual Basic properties and events.
Crescent SoftWare's QuickPack for Windows package consists of the following custom controls:
The CSInvis control is an invisible button control. This control is used when you want to define areas in a picture (HotSpots) that users could select through the click of the mouse when they require additional information.
The CSPict control provides additional properties and methods when used with the Picture control supplied with Visual Basic.
By using the CSPict control, the following additional functionality is added to the Picture control:
The CSDialog control is a combination of six common dialogs that can be used in your application.
The common dialogs included are:
Because the dialogs are separated into different controls, you are able to concentrate only on the properties and methods that are relevant for the type of dialog that you are creating.
With Visual Basic, all of the functionality appears in one control.
The CSForm control adds additional functionality to the forms in your application, as follows:
The CSCalendar control provides the user with a graphic representation of a calendar from which dates can be selected.
The CSMeter control provides a progress bar indicator to indicate the progression of a long operation. The gauge can be used to represent a horizontal or vertical filing process.
Using the CSopt control, it is possible to create a framed group of option buttons. In order to accomplish this same task in Visual Basic, you would need to use a frame control and one or more option buttons.
The CSPictur control is similar to the picture control supplied with Visual Basic. The CSPictur control adds the following functionality to your application:
The CSSpin control is used in conjunction with another control in order to provide the user with a visible method of increasing or decreasing the value of an associated control. The CSSpin control adds the following functionality to your application:
The CSText control is a combination of seven controls.
The controls listed provide the following enhancements over the controls supplied with Visual Basic.
Using the CSChklist control, it is possible to create a framed group of check boxes. In order to accomplish this same task in Visual Basic, you would need to use a frame control and one or more check boxes.
The CSCombo control is similar to the standard ComboBox supplied with Visual Basic. The following additional features have been provided in order to enhance the control:
The CSCommand control is similar to the standard command button supplied with Visual Basic. The following additional features have been provided in order to enhance the control:
The CSGroup control provides the same functionality as the Frame control supplied with Visual Basic. The following additional features have been provided in order to enhance the control:
The CSVlist and QPList controls are similar to the standard ListBox control supplied with Visual Basic. The following additional features have been provided in order to enhance the control:
The CurTime Control provides your application with a continuously updating clock. The time is displayed to the user through a 3D panel-type control. Additionally the CurTime control contains an alarm function.
Also provided with QuickPack is the QPRO DLL. This library is provided in the form of a Windows-callable DLL. Contained in the DLL are over 350 powerful routines that can be called from your application. The DLL provides routines that could be
programmed in Visual Basic; however, some of the functions provided return information that is not accessible to Visual Basic. All of the routines have been written in either Assembler or C so there will not be any performance impact in using the routines.
The routines are grouped into the following areas:
Figure 30.1 illustrates some of the controls contained in the QuickPack Package.
Figure 30.1. QuickPack Package controls.
Crescent SoftWare QuickPack Plus can be ordered from:
Crescent SoftWare
11 Bailer Avenue
Ridgefield, CT USA 06877
Telephone (203) 438-5300
Fax (203) 431-4626
The Designer Widgets package provides custom controls to visually enhance your application. The Designer Widgets package is made up of the following custom controls.
The SSFormFX control is used to enhance the appearance of the forms in your application. The control can be used to add the following functionality to your application:
Figure 30.2 illustrates the use of the custom control in order to provide 3D minimize, maximize, and a smaller 3D control panel selector.
Figure 30.2. 3D Minimize and Maximize custom controls.
The SSIndexTab control provides a tabbed dialog much like that found in other Windows applications. The tab control allows you to organize a large amount of information on one form without needlessly cluttering up the screen. Using the tab control, you
are able to group like items together, and allow the user to quickly switch between the item types. The control can be used to add the following functionalities to your application:
Figure 30.3 illustrates the use of the Tab control to display titles, publishers, and author information from the BIBLIO database.
This SSToolbar control provides a full-featured dockable ToolBar much like that seen in other Windows applications. Figure 30.4 illustrates the appearance of this ToolBar. The dockable ToolBar provides the following features to enhance your
applications:
Figure 30.4. SSToolbar ToolBar control.
Sheridan SoftWare Designer Widgets can be ordered from:
Sheridan SoftWare
35 Pinelawn Road Suite 206E,
Melville, NY USA 11747
Telephone (516) 753-0985
Fax (516) 753-3661
The Message Blaster Custom Control is a freeware control that was developed by Ed Staffin of Microsoft consulting services. You can obtain the control as well as samples that illustrate its many uses from the following locations:
Windows is a message-driven environment. If you were developing an application in C or C++, you would decide which of the Windows messages your application would act upon, and ignore the ones you felt were of no importance. In the Visual Basic
environment this decision has been made for you. It is not possible using Visual Basic to redefine the messages that a particular control or application will respond to. For example, in Visual Basic it is not possible to enable a MDIForm to react to a
double-click from the mouse on its area.
With the advent of the Message Blaster control your application has the opportunity to respond to the messages received from Windows prior to Visual Basic intercepting them.
The sample applications that are supplied with the Message Blaster Custom Control illustrate how the control could be used to display a reduced-sized control box, much like that of the Visual Basic ToolBox. Figure 30.5 illustrates the output from the
SmallCap sample provided with the Message Blaster control.
Figure 30.5. Message Blaster control.
The Data Widgets package provides custom controls that allow you to have much more flexibility when editing and displaying data in your application. The Sheridan Data Widgets package is made up of the following custom controls.
The SSDataCommand DataBound command button provides the following features:
The SSHData/SSVData Enhanced Data Controls are used with the data control that is supplied with Visual Basic. There are two controls contained in the enhanced data control, one control displays horizontally, and the other displays vertically. The
enhanced data controls provide the following features:
The SSDataGrid DataBound grid control provides the following features:
The SSDataCombo Data Bound ComboBox control provides the following features:
The SSDropDown control can only be used with the DataControl grid control. The drop-down list control provides the following features:
The SSDataOption Bound option button provides the following features:
Figure 30.6 illustrates the use of the Data widgets to display the contents of the Titles table from the BIBLIO database.
Sheridan SoftWare Data widgets can be ordered from:
Sheridan SoftWare
35 Pinelawn Road Suite 206E
Melville, NY USA 11747
Telephone (516) 753-0985
Fax (516) 753-3661
In addition to these tools, a layout editor is also provided to define and format the contents of the columns displayed in the ComboBox, grid control, and the drop-down list.
The Formula One custom control is a tool that gives your application all of the functionality of a spreadsheet package. The Formula One control provides the following features:
Figure 30.7 illustrates the use of the Formula One control to design a spreadsheet.
Figure 30.7. Formula One controls.
Visual Components Formula One can be ordered from:
Visual Components
15721 College Blvd
Lenexa, KS USA 66219
Telephone (913) 599-6500
Fax (913) 599-6597
The TrueGrid control is a data grid control that can be either be operated bound to a database or unbound.
The TrueGrid control provides a wide range of functionality through a large range of prop-erties and methods. The following list illustrates the major features that are supported by the TrueGrid control:
Figure 30.8 illustrates the use of the TrueGrid control to design a spreadsheet.
Figure 30.8. TrueGrid control.
Apex TrueGrid can be ordered from:
Apex SoftWare Corporation
4516 Henry Street
Pittsburgh, PA USA 15213
Telephone (412) 681-4343
Fax (412) 681-4384
The Calendar Widgets package provides custom controls that allow you to have much more flexibility when editing and displaying date and time, based on information in your application. The Sheridan Calendar Widgets package is made up of the following
custom controls.
The SSMonth control provides the following features:
Figure 30.9 illustrates the use of the Calendar control used to display one month. All Saturdays will be displayed in blue, and all Sundays will be displayed in red. The button on the left represents today's date. The button on the right represents the
date that has been selected.
Figure 30.9. Calendar control.
The SSYear control contains the following features:
Figure 30.10 illustrates the use of the Year View control to display a complete year. All Saturdays will be displayed in blue and all Sundays will be displayed in red. Public holidays are indicated in green. The button on the left represents the date
today. The button on the right represents the date that has been selected.
Figure 30.10. Year View control.
The SSDateCombo control contains the following features:
Figure 30.11 illustrates the use of the Date ComboBox control for the entry of a date.
Figure 30.11. Date ComboBox control.
The SSDay DayView control contains the following features:
Figure 30.12 illustrates the use of the DayView control in order to manage a daily schedule.
Figure 30.12. DayView control.
Sheridan SoftWare Calendar Widgets can be ordered from:
Sheridan SoftWare
35 Pinelawn Road Suite 206E
Melville, NY USA 11747
Telephone (516) 753-0985
Fax (516) 753-3661
In this chapter we have examined the advantages of using third-party controls as well as major features of some of the custom controls that are currently available. In the move to Visual Basic 4.0 and the switch to OCX controls, the number of controls
that are available will increase and their functionality will continue to grow. Additional information on available custom controls can be found from the following sources:
The Companion Products booklet supplied with Visual Basic.
The Visual Basic Programmers Journal, Dr. Dobbs Journal, and Byte magazines, as well as many other periodicals.