Custom controls on the VFP toolbar

One of the great strengths of Visual Foxpro is the way that you can so easily subclass the base controls and build your own class library of custom controls. Usually you will have this class library in the Classes tab of the Project Manager and you will drag the class from there to the Form Designer in order to add that control to the form.

Sometimes though this is not possible. Perhaps you want to replace all the buttons on the standard toolbar with your own controls in order to enforce a standard look and feel across the application. Perhaps you want to add one of your controls to a grid and the drag-and-drop from a class library will not work into a grid. You need to add your classes to the standard VFP Form Controls toolbar.

Use the View Classes button on the Form Controls toolbar:

[Add custom controls to the Form Controls toolbar]

Select Add from the menu that drops down. A file selection dialog will appear showing the VFP visual class libraries. Navigate to your class library and click the Open button to display the classes from this library on the toolbar. The screenshot below shows part of the toolbar for one of our libraries. It replicates all the standard controls (with some modifications ) but the tooltip shows a new cmdClose button.

[Form Controls toolbar showing custom controls]

Back to FoxPro Developers' page


Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map