.NET
  Home arrow .NET arrow New Features for the Statusbar in 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 Features for the Statusbar in MFC
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-10-08

    Table of Contents:
  • New Features for the Statusbar in MFC
  • Animation
  • Progress bar
  • Double click response

  • 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 Features for the Statusbar in MFC


    (Page 1 of 4 )

    Expanding existing objects with new and better features is a way of imitating evolution in the living world. Still, the result is just as good as in nature. Gradually we create tools for our work that make life much easier. A similar process can be observed in the Statusbar of the Windows operating system. Let us see what improvements we have at hand with the appearance of the newest generation of tools. This is the second part of an eight-part series.

    Previously I showed you how to handle the classic Statusbar. As with everything around us, this has also improved in the last few years. This will be a great opportunity for those who want to see and learn about the new features available. If for some reason you are not familiar with how the classic Statusbar worked I strongly advise you to read my previous article titled Status Bar in MFC.

    I already mentioned that with the MFC Feature Pack launched along with Service Pack One of Visual Studio 2008, the Statusbar was improved with the addition of the following features: the capability to post images, animations, and progress bars in the Statusbar. We can also make it respond to mouse double-clicks performed within the surface of the Statusbar.

    For a quick review, let me recall the example project I created last time. I added an extra pane to the Statusbar in which I displayed the current day and the clock of the local system. Today I am going to expand on this by adding an image of a clock near it.

    First, we need to add a bitmap image to the resource. Go to the resource view and import the following picture into it:

    Change its name in the properties section to ID_STATUS_CLOCK_ICON. Now add the following lines to the end of the OnCreate section:

    CBitmap m_StatusBarClockIcon;

     

    m_StatusBarClockIcon.LoadBitmap (ID_STATUS_CLOCK_ICON);

     

    m_wndStatusBar.SetPaneIcon(m_wndStatusBar.CommandToIndex( ID_STATUS_TEXT), m_StatusBarClockIcon,TRUE);

    For starters, we loaded the image, and then set it to the corresponding pane. The icon is appended to the left side of the pane and has no influence on the size of the text. The pane's size is extended to fit in the icon near the text's side. Once compiled and run, you can see the effect:

     

    Adding small tooltip texts that pop up once you hover over a pane is just as easy with the SetTipText function:

    m_wndStatusBar.SetTipText(

    m_wndStatusBar.CommandToIndex(ID_STATUS_TEXT),

    _T(" The current time"));

     

    More .NET Articles
    More By Gabor Bernat


     

    .NET ARTICLES

    - 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
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





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