ASelObj()
ASELOBJ() tells you which objects are selected in the Form or Class Designer. With these references, you can determine and/or change an object's properties. In addition, ASELOBJ() allows you to reach "through" an object to determine the object's container or the containing form's data environment.
Usage |
nSelCount = ASelObj( ArrayName [, nContainer ] ) |
Parameter |
Value |
Meaning |
ArrayName |
Name |
The array to contain the object references. |
nContainer |
Omitted |
Get a reference to each selected object. |
1 |
Get a reference to the containing object of the selected objects. |
|
2 |
Get a reference to the data environment of the form. |
|
nSelCount |
Positive number |
The number of elements in the array, which is the number of selected objects (or 1 for a container or data environment). |
0 |
No objects were selected, or in the case of nContainer = 2, the object(s) selected is not on a form. The array is not created in this case. |
Example |
* Before typing the code below in the Command Window, * open the Form Designer and place a few labels on the form. * Select at least three labels. = ASelObj(aObjects) aObjects[1].Caption = "First Label" aObjects[2].Caption = "Second Label" aObjects[3].BackColor = RGB(255,0,255) aObjects[3].ForeColor = RGB(0,255,0) |
See Also |