Click or drag to resize

ControlNotifyEvent.NotifyCode Property

X#
The notification code for this event as defined by the Windows API.

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 VIRTUAL PROPERTY NotifyCode AS DWORD GET 
Request Example View Source

Property Value

Type: DWord
The notification code for this event as defined by the Windows API.
Remarks
The notification code for this event as defined by the Windows API. The value of the notification code depends on the type of control and the event. Refer to your Microsoft Win32 Software Development Kit documentation for more details.
Tip Tip
The ControlNotifyEvent:NotifyCode access returns a DWORD variable. NotifyCode Values in the Windows SDK are usually defines as:
X#
1DEFINE TVN_KEYDOWN       := (TVN_FIRST-12)
2DEFINE TVN_FIRST        := (0U-400U)
In prior versions of X# TVN_KEYDOWN compiled to a LONG with value -412. Most other development environments treat defines like these as DWORD (unsigned) because the TVN_FIRST has one or more unsigned constants in its definition. Unfortunately there is a small problem in X#: USUAL variables can only contain LONG or FLOAT numerics and not DWORDS. This means that if you call ControlNotifyEvent:NotifyCode late bound you will receive a USUAL and therefore a LONG. So in case the NotifyCode is TVN_KEYDOWN, then the USUAL will have a LONG value of -412. We therefore strongly advise to store Event objects in a type local. This ensures that you will get the correct numeric type:
X#
 1METHOD ControlNotify(oControlNotifyEvent) CLASS HelpAbout
 2LOCAL oControl AS Control
 3LOCAL oCNEvent AS ControlNotifyEvent
 4oCNEvent := oControlNotifyEvent
 5oControl := IIF(oCNEvent == NULL_OBJECT, NULL_OBJECT, oCNEvent:Control)
 6SUPER:ControlNotify(oControlEvent)
 7IF oCNEvent:NotifyCode == TVN_KEYDOWN
 8// Do what you want to do
 9ENDIF
10RETURN NIL
See Also