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

Programming ActiveX controls

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

To size a control while you add it

To add multiple 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

To delete a control