Transparent Rebar/Toolbar (MFC VC++ 6.0) 
Author Message
 Transparent Rebar/Toolbar (MFC VC++ 6.0)

I'm having a little but persistent problem.
I'm trying to add a bitmap to the toolbar background  (rebar) of a new
but instead off showing the bitmap, the rebar/toolbar becomes completely
(i can see the desktop).

The new MDI application is created using the MFC App Wizard (VC++ 6.0),
the explorer rebars option checked. I modified the code of the
method (see below) to add the bitmap to the toolbar background. However,
this doesn't work
and the rebar becomes transparent. I tried several other implementation
(f.e. the implementation
described in the help pages), but nothing seems to work. I also tried to
to modify the MFCIE example
application but that resulted in a transparent rebar as well. The only
example that is working is the REBAR

If anyone has any idea of what I'm doing wrong or if someone has any
other suggestion to solve this problem,
please let me know.


Maurice van SOEST

// Begin source code.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
        return -1;

    if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT | TBSTYLE_TRANSPARENT,

        WS_CHILD | WS_VISIBLE | CBRS_TOP, CRect(3, 3, 3, 3)) ||
       TRACE0("Failed to create toolbar\n");
       return -1;      // fail to create
    m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() &

    if (!m_wndDlgBar.Create(this, IDR_MAINFRAME,
        TRACE0("Failed to create dialogbar\n");
        return -1;  // fail to create

    CBitmap m_bmap;

    if (!m_wndReBar.Create(this) ||
        !m_wndReBar.AddBar(&m_wndToolBar, NULL, &m_bmap,
        !m_wndReBar.AddBar(&m_wndDlgBar, NULL, &m_bmap,
        TRACE0("Failed to create rebar\n");
        return -1;      // fail to create
    m_wndReBar.SetBarStyle(m_wndReBar.GetBarStyle() &

    if (!m_wndStatusBar.Create(this) ||
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create

     // TODO: Remove this if you don't want tool tips
     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |

     return 0;


// End of source code.

Sun, 30 Sep 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. toolbars in vc++ 6.0 (new to win32 programming)

2. toolbar in vc++ 6.0

3. VC++ 6.0 , MFC 6.0?

4. LNK 2005 error when migrating from VC++ 6.0 (MFC) to VC++ .Net

5. Toolbar (IDE) positioning in VC++ 6.0

6. VC++ 6.0 slows down after using the wizard toolbar

7. About Toolbar & Rebar - when user click toolbar and rebar...-

8. backward compatibility vc++ .net vc++ 6.0

9. MDI and toolbar (or rebars)?

10. MDI and Toolbars (or Rebar)

11. vc++ 5.0 to vc++ 6.0 problem

12. coolbar/rebar seperator in toolbar


Powered by phpBB® Forum Software