PRB: "Expand is not an array" Error When Using Outline ControlID: Q139872 3.00 WINDOWS kbole kbprb kbdocerr The information in this article applies to:
SYMPTOMSThe Outline control has an Expand property and an Expand event. According to Visual FoxPro Help, you can expand an item of an Outline control (Outline1) by using this code:
However, this code produces this error:
CAUSEVisual FoxPro is interpreting Expand as a property of the Outline container object. The syntax is similar to referencing Expand as an array. That is why Visual FoxPro reports this error. You need to tell Visual FoxPro that this is a property of the OLE control that the container is holding. The Help documentation is incomplete.
RESOLUTIONThe Object property provides access to the OLE server properties and methods for an OLE object. Therefore, to expand an item, you can use this code:
This assumes that the <item#> of the Outline control contains subordinate
items and that it is currently collapsed.
STATUSThis behavior is by design.
MORE INFORMATIONThe Outline control (Msoutl32.ocx) is a special type of list box that you can use to display items in a list hierarchically. This is useful for showing directories and files in a file system; it is the technique used by the Windows File Manager.
Steps to Reproduce Behavior1. Open the Debug window, and enter this line:
2. Use the DO FORM command to run the Outline1.scx form in the Samples\Ole
3. Click the Select a Database button, and select the Testdata.dbc (from
4. Click different lines on the Outline Sample form to see that the
5. To expand the Customer item programmatically, type the following command
6. To get the correct behavior, use the following line of code instead:
Additional reference words: 3.00 VFoxWin
KBCategory: kbole kbdocerr kbprb
KBSubcategory: FxinteropOcx
|
Last Reviewed: November 21, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |