Using the Cicode functions _ObjectSetProperty and _ObjectCallMethod, it is possible to set a property or call a method on the Database Exchange control at runtime.
Example: Setting Properties at Runtime
The following example illustrates how to create two buttons that display and hide the menu bar on the Database Exchange ActiveX control at runtime. The property being set is ShowMenuBar.
Note: This procedure assumes that a Database Exchange ActiveX control has been placed on the graphics page at AN 35
To create a button that displays the menu bar:
_ObjectSetProperty(ObjectByName("AN35"), "ShowMenuBar", TRUE)
To create a button that hides the menu bar:
_ObjectSetProperty(ObjectByName("AN35"), "ShowMenuBar", FALSE)
Example: Calling a Method at Runtime
This example shows how to call a method on the control at runtime using the Cicode function _ObjectCallMethod.
_ObjectCallMethod(ObjectByName("AN35"), "DownloadData", -1)
Note: 1 (signifying the currently selected row) is the argument of the DownloadData method.
The result of executing this Cicode is equivalent to clicking on the Select button on the Database Exchange control menu after a row has been selected.
For descriptions of each method, see the full List of Methods.
Note: For more information on the methods _ObjectSetProperty and _ObjectCallMethod, see the Citect Help