New MFC Toolbar Controls in Visual Studio 2010

With VC++ Feature Pack Microsoft has added new classes to MFC to provide support for new controls. However, these controls were not available from the designer. One had to manually wrote all the code for enabling an application to use these controls. Visual Studio 2010 Beta 2, released a couple of weeks ago, provides support in the designer for these controls.

MFC controls in the Toolbar
MFC controls in the Toolbar

Here is a screen shot of a dialog application with these controls:

New MFC Controls
New MFC Controls

The controls are:

  • Color button (CMFCColorButton): represent a color picker control allowing users to select a color
  • Font combo box (CMFCFontComboBox) : represent a combo control that displays a list of fonts available in the system
  • Edit browse (CMFCEditBrowseCtrl): an editable control with a button that displays a dialog for selecting a file or a folder
  • Visual Studio list box (CVSListBox): an editable list control with buttons for adding, removing or rearranging items in the list
  • Masked edit (CMFCMaskedEdit): a masked edit control that has a string template representing the structure of the allowed input, which is validated against the value provided by the user
  • Menu button (CMFCMenuButton): displays a pop-up menu (from a menu resource) and reports the command selected by the user
  • Property grid (CMFCPropertyGridCtrl): an editable property grid control
  • Shell list (CMFCShellListCtrl): a list control that displays the files and folders from you system just list Windows Explorer list view does
  • Shell tree (CMFCShellTreeCtrl): a tree control that displays the folder from your system just like the Windows Explorer folder view does
  • Link control (CMFCLinkCtrl): is a special button that has the appearance of a hyperlink and invokes the target link when pressed

Not all the properties for these controls are available from the designer. For instance the properties list still needs hand coding, it is not possible to select a menu resource for the menu button nor the starting point for the shell tree and list. However, having them available in the toolbar is a good step forward.

6 Replies to “New MFC Toolbar Controls in Visual Studio 2010”

  1. Thank you Microsoft for continuing to support MFC. You have made many native developers happy again.

  2. i am knew to MFC programming…..
    i wish u can help me out with my problem
    CFileDialog fd(TRUE,”txt”, “vicon_cams_data”, OFN_HIDEREADONLY|OFN_FILEMUSTEXIST,
    “Vector Data Files (*.txt)|*.txt|*.dat||”, this);
    when i write the above line in visual studio 2010, iam getting a readline below TRUE saying an error:no instance of constructor CfileDialog matches argument list..
    i checked the definition of CFileDialog in afxdlgs.h according to it its perfect…still i am not able to fix it…
    I am using Windows 7 Basic

  3. Red line below TRUE does not mean anything unless you get an error during compilation. However, this is a problem to address in programming forums, not on blogs. Please do so.

  4. Could you please send me a source code of MFCDemo project. I am new to MFC and i will to check the way you the controls. Thanks a lot!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.