.NET
  Home arrow .NET arrow New Controls for MFC
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

New Controls for MFC
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-10-20

    Table of Contents:
  • New Controls for MFC
  • Create a property sheet inside a dialog
  • Style and Radio Buttons
  • Push buttons
  • Menu buttons

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    New Controls for MFC


    (Page 1 of 5 )

    Looking for information on the new controls in the MFC Feature Pack? Don't expect to find it in a book. Keep reading this article, on the other hand, and you'll find all the details you could want.

    Nowadays, there are a couple of fast evolving markets. IT is certainly one of them. Documenting all the modifications and extending them is hard work. There are countless hours of intensive research, writing, probing and rewriting of entire paragraphs for a technical book to appear. By the time you manage to write a high quality book, there is a high chance that technology you describe it is already outdated.

    Therefore, I am not surprised that last time I searched for a book/article describing the new controls introduced by the MFC Feature Pack, I found nothing. This article will try to fill this lack. I will describe each control in depth, in code and images. To demonstrate it visually I will use the following sample you can download from the MSDN: New Controls.

    Although I find the online documentation hard to decipher, what is truly interesting is that this application is well written. You can split up the controls into six main categories: Buttons, Color Controls, Masked Edit, List Controls, Shell Controls and other controls. The application will resemble this list.

    We will integrate all the controls into a single dialog. To avoid a big mess, we will use property pages. There exists a class for this in the feature pack as well, named CMFCPropertyPage. This supports the display of pop-up menus on a property. This is just what we need. To use them, we need to complete a couple of steps.

    First, start up the resource manager and add a new dialog. Populate it with various controls that will host the new ones. Obviously, you will not find the corresponding items in the toolbox to do so. However, use items that behave similarly. For instance, a color picker acts like a button: push it in a place and you generate an action.

    Then use the add class option for the dialog. Within this, you can replace the button's definition -- for example, with a color picker, and so on. Replace the CDHtmlDialog to CMFCPropertyPage. Now we can override/extend two main functions.

    The application calls the OnInitDialog when it creates the property page. The second call is to the DoDataExchange, which will help us to synchronize the data inside the property page and the ones in the memory. Use the first to initialize the objects and define their behavior. If you created the right type of object, you can leave the second function as it is. It will synchronize any specific change to the corresponding function.

    More .NET Articles
    More By Gabor Bernat


     

    .NET ARTICLES

    - Introducing .NET
    - Building Business Objects for an Application
    - Methods for an Application`s Business Logic ...
    - Properties of an Application`s Business Logi...
    - Classes and Properties in an Application`s B...
    - Organizing Code for the Business Logic Layer...
    - Building the Business Logic Layer
    - Completing a Business Layer with Windows Wor...
    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek