Combobox member variable messages? I can get ON_CBN_SELCHANGE but not ON_CBN_KILLFOCUS?
-
I have two different situations where I have comboboxes that are part of a view. I can't seem to get all the combobox messages. A. I have a member variable that is part of a listview class. I make a handler for ON_CBN_SELCHANGE and I get that just fine, but I make a handler for ON_CBN_KILLFOCUS and I don't get that message??? I can get a ON_EN_KILLFOCUS for a CEdit member of the same view. Is there something special about ON_CBN_KILLFOCUS? B. I have, also in this view, a combobox, added to a toolbar. Both are members of the view. I do all the positioning myself. The toolbar's parent is the listview (this) and the comboboxes parent is the toolbar (m_tbrColumns). How can I get the messages for the combobox in the view?? I don't get any messages for this combobox in the view. thanks mike
-
I have two different situations where I have comboboxes that are part of a view. I can't seem to get all the combobox messages. A. I have a member variable that is part of a listview class. I make a handler for ON_CBN_SELCHANGE and I get that just fine, but I make a handler for ON_CBN_KILLFOCUS and I don't get that message??? I can get a ON_EN_KILLFOCUS for a CEdit member of the same view. Is there something special about ON_CBN_KILLFOCUS? B. I have, also in this view, a combobox, added to a toolbar. Both are members of the view. I do all the positioning myself. The toolbar's parent is the listview (this) and the comboboxes parent is the toolbar (m_tbrColumns). How can I get the messages for the combobox in the view?? I don't get any messages for this combobox in the view. thanks mike
Answer to (b): If you want MFC message maps to work, you'll have to override toolbar's OnCmdMsg. You should call the view's OnCmdMsg first:
BOOL CYourToolbar::OnCmdMsg(...)
{
if (m_pParent->OnCmdMsg(...))
{
return TRUE;
}return CToolBar::OnCmdMsg(...);
}Tomasz Sowinski -- http://www.shooltz.com