Udostępnij za pośrednictwem


Defining Member Variables for Dialog Controls

To define a member variable for any dialog box control except buttons, you can use the following method.

Note

This article applies only to dialog controls within an MFC project. ATL projects should use the New Windows Messages and Event Handlers dialog box.

To define a member variable for a (non-button) dialog box control

  1. In the Dialog editor, select a control.

  2. While pressing the CTRL key, double-click the dialog box control.

    The Add Member Variable wizard appears.

  3. Type the appropriate information in the Add Member Variable wizard. For more information, see Dialog Data Exchange.

  4. Click OK to return to the Dialog editor.

    Tip

    To jump from any dialog box control to its existing handler, double-click the control.

For information on adding resources to managed projects, please see Resources in Applications in the .NET Framework Developer's Guide. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resources strings to properties, see Walkthrough: Localizing Windows Forms and Walkthrough: Using Resources for Localization with ASP.NET.

You can also use the Member Variables tab in MFC Class Wizard to add new member variables for a specified class, and view those that have already been defined.

Requirements

MFC

See Also

Tasks

Mapping Messages to Functions

Adding a Member Function

Adding a Member Variable

Overriding a Virtual Function

Reference

MFC Class Wizard

Concepts

Adding Functionality with Code Wizards

Adding a Class

Adding an MFC Message Handler