Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Capturing ToolbarEvent inside Dialog

Capturing ToolbarEvent inside Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestionannouncementlearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pazzuzu
    wrote on last edited by
    #1

    Hi Guys, I have a Dialog Resource in my resourceEditor & I have created a class out of it say "C_TestDialog",which is derived from CDialog. I want to place a Toolbar control in this dialog. So I have added a "ToolBarcontrol" also in my resourceEditor. Now If I take my ClassWizard,& select the "C_TestDialog" under class name.In the "ObjectIDs" section I see my classname & in the Messages column,I see all of the events,messages etc of this class. Now What I need now is,How can I include my "toolbarcontrol" also inside the ObjectIDs section,under the className "C_TestDialog",so that I can see all the messages related to the toolbar control. RightNow,If I select my toolBarcontrol(IDR_SelectToolBar) inside the ObjectIDs section,I see only 2 messages - "COMMAND" & "UPDATE_COMMAND_UI". Iam creating my toolbar as follows: CRect toolbarSize(20,20,300,50); //m_toolBarCtrl is the member varibale of type C_ToolBarCtrl-- which is a member of C_TestDialog class. m_toolBarCtrl.Create(WS_CHILD|TBSTYLE_FLAT,toolbarSize,this,IDR_SelectToolBar); m_toolBarCtrl.AddBitmap(1,IDB_BITMAP1); TBBUTTON tb[2]; // Index of new button image. tb[0].iBitmap = 0; // Setting button state tb[0].fsState = TBSTATE_ENABLED; // Setting button style tb[0].fsStyle = TBSTYLE_BUTTON; tb[0].dwData = 0; tb[0].iString = NULL; m_toolBarCtrl.AddButtons(1,tb); m_toolBarCtrl.ShowWindow(true); Note: Don't want to create a class derived from CToolBarCtrl.Want to access the Messages of the "toolbar" from my C_TestDialogClass.(For eg.- when the user clicks on the toolbar at runtime,I want this event to be trapped inside my C_TestDialog class) Any Help is appreciated. Thanks...

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups