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 intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Microsoft provides this sample code "AS IS" with no warranties.

To get samples and instructions for installing them:

To access samples from Visual Studio

  • On the Help menu, click Samples.

    By default, these samples are installed in drive:\Program Files\Microsoft Visual Studio 10.0\Samples\.

  • For the most recent version of this sample and a list of other samples, see Visual Studio Samples on the MSDN Web site.

Requirements

This sample requires Windows Vista or later.

See Also

Reference

MFC Controls Samples