Objective Grid: Initiating a message box when a change occurs

Article ID: 123
Last updated: 04 Jun, 2018
Article ID: 123
Last updated: 04 Jun, 2018
Revision: 3
Views: 1744
Posted: 19 Jan, 2001
by Meltreger B.
Updated: 04 Jun, 2018
by Meltreger B.

Problem


Is it possible to bring up a message box when a user makes a change in a CGXComboBox? I need a Yes/No response when the user changes the control.


Cause



Action


Yes, you should override OnStoreDroppedList() and set an attribute (e.g. m_bDisplayBox = TRUE). Furthermore, you should override DestroyDropDownWnd() and display the message box

Example:

void CMyComboBox::DestroyDropDownWnd(CWnd* pDropDownWnd)
{
CGXComboBox::DestroyDropDownWnd(pDropDownWnd);

if (m_bDisplayBox)

AfxMessageBox("This is a message");
m_bDisplayBox = FALSE;
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 123
Last updated: 04 Jun, 2018
Revision: 3
Views: 1744
Posted: 19 Jan, 2001 by Meltreger B.
Updated: 04 Jun, 2018 by Meltreger B.

Others in this category