Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3027

CMFCToolBar::ReplaceButton() has no effect

$
0
0
actually I want to solve a quite simple thing, but I spent already the whole day...now I am running out of ideas!

The requested behaviour: depending on program state I want to display different buttons at the Toolbar.

At first step, I tried to exchange a button in CMainFrame::OnCreate(...) !! It is a SDI sample

Code:

 
{
      CMFCToolBarButton    button(ID_ONLINE,IDB_GO_ONLINE,(LPCTSTR)"ONLINE");

                int ret = m_wndToolBar.ReplaceButton(ID_ONLINE,button);
      TRACE("%d",ret);
  }

the retcode '1' says, that button is exchanged, but nothing happened. The original button image and text from resource toolbar is still displayed.
Hint: the IDB_GO_ONLINE ID is the ID of a bitmap resource, which I have created with same size and resolution than toobar (16x15,24 Bit)

Could anybody help?

Viewing all articles
Browse latest Browse all 3027

Latest Images

Trending Articles



Latest Images