4.1.1.2.4 Handling Edit Box and Rich Edit Box Events

Event macros for use with Origin C EditBox and RichEditBox objects include:

Macro Description
ON_KEY(_idCntrl, _ocHandler) When a key is pressed (a character is typed) in the edit box having the resource ID _idCntrl the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl, UINT msg, UINT wParam, UINT lParam)
ON_WM_VSCROLL_BEFORE(_idCntrl, _ocHandler) When the edit box having the resource ID _idCntrl is scrolled vertically the function _ocHandler is run before the edit box updates. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl, uint nScrollCode, uint nScrollPos)
ON_WM_HSCROLL_BEFORE(_idCntrl, _ocHandler) When the edit box having the resource ID _idCntrl is scrolled horizontally the function _ocHandler is run before the edit box updates. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl, uint nScrollCode, uint nScrollPos)
ON_WM_VSCROLL(_idCntrl, _ocHandler) When the edit box having the resource ID _idCntrl is scrolled vertically the function _ocHandler is run after the edit box updates. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl, uint nScrollCode, uint nScrollPos)
ON_WM_HSCROLL(_idCntrl, _ocHandler) When the edit box having the resource ID ''is scrolled horizontally the function _ocHandler is run after the edit box updates. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl, uint nScrollCode, uint nScrollPos)

For additional event macros that may be of use with Edit Box and Rich Edit Box controls see the following table. For detailed examples demonstrating how to handle Edit Box and Rich Edit Box events see the topics Accessing an Edit Box and a RichEdit Control with Origin C and Accessing Radio Button and Edit Box Controls with Origin C.

Macro Description
ON_EN_CHANGE(_idCntrl, _ocHandler) When the text of the edit box having the resource ID _idCntrl is changed the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler(Control ctrl)
ON_EN_KILLFOCUS(_idCntrl, _ocHandler) When the edit box having the resource ID _idCntrl looses focus the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl)
ON_EN_SELCHANGE(_idCntrl, _ocHandler) When the selection of text in the edit box having the resource ID _idCntrl is changed the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl)
ON_EN_VSCROLL(_idCntrl, _ocHandler) When the edit box having the resource ID _idCntrl is scrolled vertically the function _ocHandler is run. _ocHandlerhas the prototype:
BOOL _ocHandler(Control ctrl)
ON_EN_HSCROLL(_idCntrl, _ocHandler) When the edit box having the resource ID _idCntrl is scrolled horizontally the function _ocHandler is run. _ocHandler has the prototype:
BOOL _ocHandler(Control ctrl)