Solved

Changing ImageList in of ToolBar

Posted on 1998-06-08
3
605 Views
Last Modified: 2013-11-20
I want to change the Imagelist of a ToolBar. The Toolbar is created and okay. Then the user can change the bitmap at runtime. How can I change the Bitmaps of the ToolBar to the new ones?
0
Comment
Question by:Heinig
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1316186
You can add more images to toolbar imagelist with CImageList::Add and then replace bitmap on a particular button with CToolBar::SetButtonInfo.
0
 

Author Comment

by:Heinig
ID: 1316187
That's not solving my problem, but it was a good hint. The ToolBar i have has some more features which are stored in registry. I don't want to Add new bitmaps to the Toolbar, because in Registry the other (old) bitmapnumber is stored. So I have to change the bitmap directly. Something like CImageList::Replace(...). But that doesn't seem to be the right way.
0
 
LVL 1

Accepted Solution

by:
motigust earned 100 total points
ID: 1316188
If you are using CToolBar class as your base class for the toolbar, you may use the CToolBar::LoadBitmap function. That function loads a specified bitmap from the resources. You may use this to replace all the images.

If you want to replace a specific image in your toolbar, you must
create and manage a bitmap yourself, and then use the CToolBar::SetBitmap function, each time you want to set the images.

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 55
ASCII Non-Printable characters/codes and their HTML equivalents 6 143
windows 10 how make picture as desktop background 2 66
List out all word 7 332
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question