The default Cancel property value.

Usage

Set_Property(OLECtrlEntID, "OLE.DefaultCancelBehavior", Value)

Values

Value can be any positive or negative whole number:

Default: 0

Remarks

The DefaultCancelBehavior property determines the preset value of the Cancel property before an event is fired. This effects all "pre" events such as BeforeUpdate, PosChanging, etc.

Normally, the Cancel property is set to 0 before an event is fired requiring the developer to set the property to 1 or 2 if a cancellation is desired. In some cases, it may be preferred to set the Cancel property to 1 or 2 before the event is fired therefore requiring the developer to set the Cancel property to 0 to allow the event process to continue.

If you set this value to 1 or 2, note that all events will be cancelled by default -- even events you do not qualify. Therefore, it is recommended that you process all "pre" events when setting this property to 1 or 2.

Example

// Default the Cancel property to 1 
Set_Property(@Window:".OLE_EDITTABLE", "OLE.DefaultCancelBehavior", 1) 

// Default the Cancel property to 2 
Set_Property(@Window:".OLE_EDITTABLE", "OLE.DefaultCancelBehavior", 2)

See Also

Cancel

  • No labels