Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

Dynamically add Item to CToolBar

Hi , I have a question that Is it possible to Dynamically
add a new button to CtoolBar object. I can do it by subclass
the CToolBar class at initialization. But what I want to do
is Dynamically adding a truely new button(not know of it at initialization). Who know of it ?
0
lwei
Asked:
lwei
  • 2
1 Solution
 
galkinCommented:
You can both add and delete buttons to the toolbar by accessing corresponding member functions of class CToolbarCtrl:
to add button AddButtons, to delete - DeleteButton, to insert button -  InsertButton. To obrain pointer to CToolbarCtrl you can call CToolbar's GetToolbarCtrl() function. You laso can use toolbar control messages instead of these functions
0
 
lweiAuthor Commented:
Yea , I know of it . But When I append a button , there is
some dot in the old toolbar ?

0
 
lweiAuthor Commented:
BTW , How to fresh the Toolbar after adding new button .
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now