Aracılığıyla paylaş


CMNCTRL3 Sample: Demonstrates New MFC Controls Available in Visual Studio 2008

This sample demonstrates some of the new controls available with MFC on Windows Vista, including the command link button (CButton), the pager control (CPagerCtrl), the split button (CSplitButton), and the network address control (CNetAddressCtrl).

The sample creates a tabbed dialog which contains 4 tabs, each of which demonstrates one of the controls:

  • The CPagerCtrl tab demonstrates the pager control and some of its capabilities. On this tab you can control the border size, background color, and button size of the pager.

  • The CButton (Command Link) tab demonstrates the command link button and some of its capabilities. On this tab you can set the content of the note on the command link button and show or hide the elevation icon on the button.

  • The CSplitButton tab demonstrates the split button and some of its capabilities. On this tab you can set the dropdown menu content, set or clear the dropdown state, set the split style, and set the size of the split portion of the button.

  • The CNetworkAddressCtrl tab demonstrates the network address control and some of its capabilities. On this tab you can select various address types and then enter a network address and validate it against the selected address types. The edit control uses the banner capability to set the prompt text directly inside the control.

Security noteSecurity Note:

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

To get samples and instructions for installing them:

  • On the Visual Studio Help menu, click Samples.

    For more information, see Visual Studio Samples.

  • The most recent version and complete list of samples is available online from the Visual Studio 2008 Samples page.

  • You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied into a folder under \Program Files\Visual Studio 9.0\Samples\. For Express editions of Visual Studio, all samples are located online.

Requirements

This sample requires Windows Vista or later.

See Also

Reference

MFC Controls Samples