Control Coder Control Coder

Ever wished when you pasted a control some of its events were already coded? Control Coder gives you this functionality.

Coding an Event

Coding an Event

The control types on the current form are listed in the 'Control' DropDown. When a control is selected its events are listed in the 'Events' DropDown. Select the control/event combination you want to code. Enter the code for the event in the code TextBox. You have the option to create a header for the events, an error handler if you want one and whether to confirm the event code at design time. 'Standard Elements' can be added to the code. These are listed below: -

To ease the development of the coded events, projects can be setup using another project as a template. Select the project you want as a template and click the 'Setup' CommandButton.

To reset the events for a project use the 'Clear' CommandButton alongside the Project DropDown. For the events for a control use the 'Clear' CommandButton alongside the controls DropDown. To clear the code for a particular event use the 'Clear Event' CommandButton alongside the Error Handler DropDown.

The events for a particular control are read from a file located in the 'install path\Events\' folder and named using the format 'LibraryName.ClassName.txt'. Thirty five events files have been supplied as part of the TurboVB zip file. A zip file (63k) can be downloaded that contains over one hundred other events files.

To use other controls that aren't in the zip file with Control Coder you have to manually create an events file based on the following format: -

'install path\Events\LibraryName.ClassName.txt', for example 'c:\Program Files\TurboVB\Events\MsComCtl2.DTPicker.txt' for the DateTimePicker.

To find the project and control name to use, examine the control in the VB Object Browser, Shortcut 'F2'.

The quickest method is to select all the events for the control in the VB Code Window DropDown and use File/Replace to remove the unnecessary code. Examine any of the supplied files for an example.

Some defaults on Control Coder are controlled by Control Coder Options.