Solved

Creating Toolbar Wrapper Class

Posted on 1997-07-29
2
560 Views
Last Modified: 2013-11-20
I was reading a great article on the MSDN cd's about the new toolbar. And I decided to
create my own wrapper class around it.

The interface to this CWnd derived class would be something like

Create
SetImageList
SetDisabledImageList
SetHotImageList
AddButton
DelButton
SetButton
.
.


First of all, the only way I succeeded in creating a toolbar with buttons, was using the
api(?):

      CreateToolbarEx

Which takes bitmap/buttons as argument - not as flexible as I would like.


So my question is this:

Having a handle to a toolbar, created with CWnd()->Create(...), is it possible to add
buttons dynamically?
How is this done? What sort of initializing should be done??? A small piece of code would be
great, but not essential...

0
Comment
Question by:mtoft
[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
2 Comments
 
LVL 4

Accepted Solution

by:
mbhakta earned 50 total points
ID: 1302894
Why are you taking all this trouble ?

CToolBarCtrl is the MFC wrapper for the new Win32 Toolbar. It covers all the things you would need to create a toolbar. You can derive your wrapper class from the CToolBarCtrl if you want something more. In the CToolbarCtrl there is a method called AddButtons() which allows you to add buttons dynamically.
0
 
LVL 2

Author Comment

by:mtoft
ID: 1302895
Sorry about the delay...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

734 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