ComboBox in Toolbar
-
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 !
-
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 !
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"