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. ComboBox in Toolbar

ComboBox in Toolbar

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 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.
  • _ Offline
    _ Offline
    _crs_
    wrote on last edited by
    #1

    Hello, I want to create a toolbar with a combobox in it and to detect when the combobox is updated !!! toolbarFont.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); toolbarFont.LoadToolBar(IDR_TOOLBARFONT); toolbarFont is a CToolbar object; I have created some buttons in toolbar (ID_BUTTONFONTSTYLE for example) and then : nIndex = toolbarFont.GetToolBarCtrl().CommandToIndex(ID_BUTTONFONTSTYLE); toolbarFont.SetButtonInfo(nIndex, ID_BUTTONFONTSTYLE, TBBS_SEPARATOR, 150); toolbarFont.GetToolBarCtrl().GetItemRect(nIndex, &rect); rect.top = 1; rect.right = 400; rect.bottom = rect.top + 250; comboFontStyle.Create(CBS_DROPDOWNLIST | CBS_SORT | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, rect, &toolbarFont, ID_BUTTONFONTSTYLE); everything works fine but how do I catch an event from the combobox ??? or any other ideea how to create it... ? thanks !

    R 1 Reply Last reply
    0
    • _ _crs_

      Hello, I want to create a toolbar with a combobox in it and to detect when the combobox is updated !!! toolbarFont.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); toolbarFont.LoadToolBar(IDR_TOOLBARFONT); toolbarFont is a CToolbar object; I have created some buttons in toolbar (ID_BUTTONFONTSTYLE for example) and then : nIndex = toolbarFont.GetToolBarCtrl().CommandToIndex(ID_BUTTONFONTSTYLE); toolbarFont.SetButtonInfo(nIndex, ID_BUTTONFONTSTYLE, TBBS_SEPARATOR, 150); toolbarFont.GetToolBarCtrl().GetItemRect(nIndex, &rect); rect.top = 1; rect.right = 400; rect.bottom = rect.top + 250; comboFontStyle.Create(CBS_DROPDOWNLIST | CBS_SORT | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, rect, &toolbarFont, ID_BUTTONFONTSTYLE); everything works fine but how do I catch an event from the combobox ??? or any other ideea how to create it... ? thanks !

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      You should be able to catch the combo box messages inside your frame class just like any other menu/toolbar message. You may not be able to use ClassWizard to do it, so you might have to edit the code manually. Hope this helps,

      Ryan

      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

      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