Compartilhar via


Switching Between Dialog Box Controls and Code

In MFC applications, you can double-click on dialog box controls to jump to their handler code or to quickly create stub handler functions.

With a control selected, click the ControlEvents button or the Messages button in the Properties window to view a complete list of Windows messages and events available for the selected item. Choose from the list to create or edit handler functions.

To jump to code from the dialog editor

  • Double-click on a control within the dialog box to jump to the declaration for its most-recently implemented message handling function. (For ATL-based dialog classes, you always jump to the constructor definition.)

To view events for a control

  • With a control selected, click the ControlEvents button in the Properties window.

    Note

    Clicking the ControlEvents button when the dialog box has focus exposes a list of all the controls in the dialog box, which you can then expand to edit the events for the individual controls.

    When a single control has focus in the dialog box, you can right-click it and select Add Event Handler from the shortcut menu. This enables you to specify the class to which the handler is added. For more information, see Adding an Event Handler.

To view messages for a dialog box

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.

Requirements

Win32

See Also

Reference

Dialog Editor