OnNotify and the MFCGrid
-
Hello, I'm using the MFCGrid and I want my code to respond to the user editing a cell. It's a dialog based application. Looking at the demo app, it's looks like I should create the following mapping: ON_NOTIFY(GVN_ENDLABELEDIT, IDC_GRID, OnGridEndEdit) However, I am creating the Grid control dynamically in the code using m_pGridCtrl->Create(rect, this, 100); instead of binding it to a Custom Control on the dialog, therefore I don't have the equivelent of IDC_GRID. Is there another way to bind the WM_NOTIFY message to a instantiated variable of the control. Thanks, John
-
Hello, I'm using the MFCGrid and I want my code to respond to the user editing a cell. It's a dialog based application. Looking at the demo app, it's looks like I should create the following mapping: ON_NOTIFY(GVN_ENDLABELEDIT, IDC_GRID, OnGridEndEdit) However, I am creating the Grid control dynamically in the code using m_pGridCtrl->Create(rect, this, 100); instead of binding it to a Custom Control on the dialog, therefore I don't have the equivelent of IDC_GRID. Is there another way to bind the WM_NOTIFY message to a instantiated variable of the control. Thanks, John
In effect the
Create()
has done the binding for you. All you have to do is putON\_NOTIFY(GVN\_ENDLABELEDIT, 100, OnGridEndEdit)
in the message map (maybe using "IDC_GRID" might be better than just "100"). HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.
-
In effect the
Create()
has done the binding for you. All you have to do is putON\_NOTIFY(GVN\_ENDLABELEDIT, 100, OnGridEndEdit)
in the message map (maybe using "IDC_GRID" might be better than just "100"). HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.
OOPs, I didn't realise that the third parameter was the resource ID, I thought it was some combination of default flags. Thanks very much!