Subclasses an OI control.

Syntax

rv = Send_Message(Ctrl, "OLE.Subclass", Handle, CtrlId)

Parameters

ParameterDescription
HandleHandle to the control being subclassed
CtrlIdName of the control which will be used to reference it in properties, methods, and events

Remarks

The Subclass method is the most important element of the OLE Subclass control. None of the other properties, methods, and events will have any effect if a control has not yet been subclassed. Subclassing is quite easy. All you need is the Windows handle to the OI control you want to subclass, which you can get using the OI standard "HANDLE" property. Then, pass the handle along with a unique name to identify the control.

The control ID should always be the full control entity id. This ensures easy use when the control ID is later passed back to you via event parameters. However, periods cannot be used in property indexes in OI. Instead, when referring to a control via an index property, use semicolons instead of periods. For instance, if you subclass MY_FORM.MY_EDITLINE, then adding an option will look like this:

Set_Property(@Window:".OLE_SUBCLASS", "OLE.OptionButton[MY_FORM;MY_EDITLINE]", 1)

If you don't want to specify the semicolon, or if you plan to manipulate many controls on the same form, then use the CurrentWindow property instead.

Example

// Subclass an EDITLINE control 
Handle = Get_Property(@Window:".EDITLINE", "HANDLE") 
rv = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Subclass", Handle, @Window:".EDITLINE")

See Also

UnsubclassCurrentWindow

  • No labels