Objective Grid: Handling combobox notifications

Article ID: 371
Last updated: 27 Apr, 2018
Article ID: 371
Last updated: 27 Apr, 2018
Revision: 3
Views: 2197
Posted: 19 Jan, 2001
by Meltreger B.
Updated: 27 Apr, 2018
by Meltreger B.

Problem

 


How can I handle combo box notifications in a CGXComboBox derived class?

 

 


Cause

 


 

 


Action

 


This can be done by overriding OnCommand( ), but you have to check for list box notifications.

Example:

BOOL CMyComboBox::OnCommand(WPARAM wParam, LPARAM lParam)
{

#if _MFC_VER <0x0300

UINT nNotification = HIWORD(lParam);
HWND hCtl = (HWND) LOWORD(lParam);
#else
UINT nNotification = HIWORD(wParam);
HWND hCtl = (HWND) lParam;
#endif
if (hCtl == m_hWnd)
{
// Edit Control changed
}
else if (GetDroppedState( ))
{
// Listbox changed
if (nNotification == LBN_SELCHANGE)
TRACE("Listbox changed " );
else
TRACE("Listbox notification %d ", nNotification );
}

return CGXComboBox::OnCommand(wParam, lParam);

}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 371
Last updated: 27 Apr, 2018
Revision: 3
Views: 2197
Posted: 19 Jan, 2001 by Meltreger B.
Updated: 27 Apr, 2018 by Meltreger B.

Others in this category