Information Bar

This bar is similar to the Outlook, Outlook express, or Front Page 98 editor. It is useful to display application specific information with text and bitmaps. You can change dynamically:

Text, Text Color, Background Color, Text Font, Bitmap.

CInfoBar class have following methods:

SetTextColor(COLORREF crNew);
SetBackgroundColor(COLORREF cr);
SetTextFont(LPCTSTR lpFontName);
SetBitmap(UINT nResID);
SetText(LPCTSTR lpszNew);

Declare in the CMainFrame header member variable


CInfoBar m_InfoBar;

In the CMainFrame OnCreate function call


/// INFO BAR CODE //////////////////////////
m_InfoBar.Create(NULL, NULL, WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | CBRS_TOP,
	         CRect(0,0,0,0), this, AFX_IDW_STATUS_BAR);
m_InfoBar.SetBarStyle(CBRS_ALIGN_TOP);

Download demo project - 46 KB

Download source - 16 KB



Comments

  • How to hide the infobar in print preview?

    Posted by Legacy on 06/04/2003 12:00am

    Originally posted by: Joerg Hoffmann


    If I hide it in my Mainframe Wnd and I select print preview it will be shown there.

    If I leave the preview the infobar will be still shown.

    What can I do?

    Reply
  • How to make infobar go all the way accross the window?

    Posted by Legacy on 11/09/2001 12:00am

    Originally posted by: Craig

    Hi,

    Let me say, great job on the class, it's really cool. I have one question though, I have a UI that is much like the DevStudio UI (CDockWnd on the left and CView on the right.) When I use the infobar, it only displays accross the CView class and stops at the CDockWnd. Is there any way to have it display above the CDockWnd as well?

    Thanks in advance,

    Craig

    Reply
  • Transparent bitmap image

    Posted by Legacy on 03/17/2001 12:00am

    Originally posted by: Ron van Gelderen

    Hi:

    How can I display a transparent bitmap image on the CInfoBar? Bitmaps with dark gray backgrounds like fine on most computers, but some have different color schemes and so the bitmap's background color doesn't match the infobar's color.

    TIA-

    Ron van Gelderen

    Reply
  • RE:Great class, just one thing

    Posted by Legacy on 02/15/2001 12:00am

    Originally posted by: Jesse Gearhart

    in infobar.cpp
    
    

    Comment the following line out:

    ModifyStyleEx(0, WS_EX_CLIENTEDGE /*WS_EX_STATICEDGE*/);


    >How can I get rid of the sunken border around the info >bar? I like it the way it's implemented in MS Outlook (no >border at all), but I haven't been able to implement it >this way yet.

    >Thanx!


    >Ron

    Reply
  • How to use the info-bar in a dialog?

    Posted by Legacy on 12/03/2000 12:00am

    Originally posted by: Michael Menne

    Does anyone know how to use the bar in a dialog instead a view.

    I tryed it with:

    m_InfoBar.Create(NULL, NULL, WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | CBRS_TOP, CRect(0,0,0,0), this, AFX_IDW_STATUS_BAR);

    in OnInitDialog(), but the bar wasen't shown even when I tryed m_InfoBar.ShowWindow();

    May anyone help me?


    Reply
  • Is there any way of putting the InfoBar in the right pane only?

    Posted by Legacy on 08/16/2000 12:00am

    Originally posted by: Nwahs

    Thanks

    Reply
  • Assertion in barcore.cpp

    Posted by Legacy on 12/26/1999 12:00am

    Originally posted by: olive

    after compiling (and only that) the infobardemo application (release or debug, static or shared) I've got the following assertion in barcore.cpp
    
    

    void CControlBar::DoPaint(CDC* pDC)
    {
    ASSERT_VALID(this);
    ASSERT_VALID(pDC); <---- Assertion !!! pDc is 0x00000000 ????

    // paint inside client area
    CRect rect;
    GetClientRect(rect);
    DrawBorders(pDC, rect);
    DrawGripper(pDC, rect);
    }

    Notice that the original infobardemo.exe works great !!!!


    My developpement environmment is
    Win95 OSR B
    VC++ 6.0 sp3
    IE5 (i've migrated from ie4 to ie5 to update some dll I thougth in cause, but with no sucess)
    thanks
    Olive

    Reply
  • Assertion in barcore.cpp

    Posted by Legacy on 12/26/1999 12:00am

    Originally posted by: olive

    after compiling (and only that) the infobardemo application (release or debug, static or shared) I've got the following assertion in barcore.cpp
    
    

    void CControlBar::DoPaint(CDC* pDC)
    {
    ASSERT_VALID(this);
    ASSERT_VALID(pDC); <---- Assertion !!! pDc is 0x00000000 ????

    // paint inside client area
    CRect rect;
    GetClientRect(rect);
    DrawBorders(pDC, rect);
    DrawGripper(pDC, rect);
    }

    Notice that the original infobardemo.exe works great !!!!


    My developpement environmment is
    Win95 OSR B
    VC++ 6.0 sp3
    IE5 (i've migrated from ie4 to ie5 to update some dll I thought in cause, but with no sucess)
    thanks
    Olive

    Reply
  • Text appears - but is blocked out

    Posted by Legacy on 08/18/1999 12:00am

    Originally posted by: Philip Bailey

    I like this control a lot and have played with the demo project successfully (VC6).

    However, when I use the control in my application, the text always appears with a white background. I can set the text colour to, say, purple and the background to dark grey. Both these changes take effect, but the purple text has a white rectangluar boarder.

    I would like the purple text to simply appear on the dark grey background.

    Any ideas would be greatly appreciated...

    Philip

    Reply
  • How do I dynamically change the text

    Posted by Legacy on 08/15/1999 12:00am

    Originally posted by: Patrick Sherrill

    I know I should know how to do this, but I don't.

    I inserted this in my MainFrame Class. Now how do I change the text dynamically from functions int my View Class?

    Thanks for your time.

    Pat..

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • The proliferation of cloud computing options has begun to change the way storage is thought about, procured, and used. IT managers and departments need to think through how cloud options might fit into and complement their onsite data infrastructures. This white paper explains cloud storage and backup, providing advice about the tools and best practices for its implementation and use. Read this white paper for some useful takeaways about how to take advantage of cloud storage for high availability, backup and …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds