Share via


Adding, Editing or Deleting Controls

Home Page (Dialog Editor)OverviewHow Do I ... Topics

You add controls to a dialog box by using the Controls toolbar to choose the control you want, then placing the control in the dialog box. You can edit the properties of a control, such as its ID, whether it is initially visible at runtime, and so forth.

You can use the shortcut menu to quickly add registered ActiveX controls to a dialog box, and you can use the Components and Controls Gallery to add an ActiveX control to the Controls toolbar of the active project.

What do you want to know more about?

Adding controls to dialog boxes

What do you want to do?

Show or hide the Controls toolbar

Add a control to a dialog box

Size a control while you add it

Add multiple controls

Add an ActiveX control to a dialog box

Add an ActiveX control to the Controls toolbar

Edit the properties of a control or controls

Delete a control

To add a control to a dialog box

  • From the Controls toolbar, select the control you want, and then either click the dialog box at the location where you want to place the control, or drag the control to that location.

    For information about the types of controls available on the Controls toolbar, see Types of Controls.

To size a control while you add it

  • After selecting the control from the Controls toolbar, place the pointer where you want the upper-left corner of the control to be, then drag to the right and down until the control is the size you want.

To add multiple controls

  • Hold down CTRL when you select a control from the Controls toolbar, and then click the dialog box as many times as you want to add this particular control. Press ESC to stop placing controls.

To add an ActiveX control to a dialog box

  1. With your cursor positioned over the dialog box, click the right mouse button and then choose Insert ActiveX Control.

  2. Select a control to insert and click OK.

    The control appears in the dialog box, where you can edit it or create handlers for it just as you would any other control.

To add an ActiveX control to the Controls toolbar

Note   This procedure adds an ActiveX control from the Components and Controls Gallery to the Dialog editor Controls toolbar. Once installed, the control remains a part of the workspace configuration and cannot be removed from the toolbar. When you open a different workspace, the Controls toolbar will appear as it was prior to your adding the ActiveX control.

  1. From the Project menu, choose Add To Project and from the submenu menu choose Components and Controls.

  2. In the Components and Controls Gallery dialog box, open the Registered ActiveX Controls folder and select a control.

    Some controls have Help files available. To see the Help file, click More Info.

  3. To add the selected control to the Controls toolbar, click Insert and then click Yes in the confirmation dialog box.

    The Confirm Classes dialog box appears.

    Note   There must be at least one project on the workspace that supports MFC. If the only project on the workspace is an ATL project without MFC support, you will receive an error message, and will be unable to insert the control.

  4. Click OK to accept the default names for the control classes, or modify them and then click OK.

  5. When you are finished adding ActiveX controls, click Close.

    The controls you have inserted now appear on the Controls toolbar.

To edit the properties of a control or controls

  • With one or more controls selected in the dialog box, choose Properties from the View menu.

    If you have multiple controls selected, only the properties common to all the controls can be edited. To undo a change, choose Undo from the Edit menu.

To delete a control

  • In the dialog box, select the control, and press DEL.