You can change the type of a control on a form, providing that the change does not break any rules regarding the control that can be the parent and the type of child control types that are permitted.
The control name, event method code, and so on, are retained, so that you do not have to first delete the existing control, add the replacement control of the required type, and then create the appropriate event methods.
To change the existing type of a control selected on a form
Select the Change Type command from the Controls menu. If the selected control has existing method references, the message box shown in the following diagram is then displayed.
Click the Yes button to confirm that you want to change the control type now. When you save the form (by selecting the Save Form command from the File menu), all method references to the control are then automatically recompiled during the save operation. (Alternatively, click the No button if you want to abandon the changing of the control type.)
The Change Control Type dialog, shown in the following diagram, is then displayed.
The
In the New Type list box, select the new type that you require for the control. The control type that you select must conform to the rules about the permitted parent control and child control types. For example, you can change a
Although you cannot change a GroupBox control that has children to a
When you have selected a valid control type, click the OK button in the Change Control Type dialog. Alternatively, click the Cancel button to abandon your selection.