When a standard control — such as a list box or edit field — doesn't meet your needs, you can create a custom control that performs a specific task. For example, the buttons on a toolbar can be custom controls.
The code that defines a custom control resides in either a DLL or, occasionally, in the .EXE file that calls the dialog box. The Dialog Editor supports custom-control DLLs and temporary custom controls, as described in the following table:
Custom Control | Description |
---|---|
DLL | A dynamic-link library (DLL) that defines one or more custom control classes. |
Temporary | A place holder for a custom control defined elsewhere. The Dialog Editor creates a gray rectangle to indicate the control's location and size. You can set the temporary control's class name, size, and other attributes to match the ones used by the final custom control. |
After a custom-control DLL is opened by the Dialog Editor, it remains available between Dialog Editor sessions. Temporary custom controls are not saved between sessions.
When the Dialog Editor opens a .DLG file that contains a custom control, it searches its list of custom-control DLLs to find a match. If a match is found (the controls have the same class name), the Dialog Editor uses the information in the DLL to display the custom control. If a match is not found, the Dialog Editor creates a temporary custom control with the given class name.
The Dialog Editor replaces any temporary custom control during an editing session when you open a DLL custom control with the same name.
The Dialog Editor adds the temporary control to the list of available custom controls. To use the temporary control, click the custom control tool. You can use the following method to add either a temporary custom control or a custom control DLL to a dialog box:
If you have more than one custom control installed (either temporary or from DLLs), the Select Custom Control dialog box is displayed. If you only have one custom control, skip to Step 6.
You cannot move the outlined control outside of the dialog once you have pressed the mouse button.