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: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • On-demand Event Event Date: October 29, 2014 It's well understood how critical version control is for code. However, its importance to DevOps isn't always recognized. The 2014 DevOps Survey of Practice shows that one of the key predictors of DevOps success is putting all production environment artifacts into version control. In this webcast, Gene Kim discusses these survey findings and shares woeful tales of artifact management gone wrong! Gene also shares examples of how high-performing DevOps …

Most Popular Programming Stories

More for Developers

RSS Feeds