Solved

Creating Toolbar Wrapper Class

Posted on 1997-07-29
2
566 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

696 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