Microsoft KB Archive/158405

= PRB: Properties of a Class May Be Evaluated at Design Time =

Article ID: 158405

Article Last Modified on 12/11/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition

-



This article was previously published under Q158405



SYMPTOMS
When placing a class on a form that has a list box or combo box that was created by a Builder in the Visual FoxPro Class Designer, the following error occurs:

Expression Evaluated to an Illegal Value



CAUSE
The Builder creates properties that reference the array, and Visual FoxPro evaluates these properties at design time. The error occurs because the array does not exist.



WORKAROUND
In the Visual FoxPro Class Designer, the ColumnCount property for both the list box and the combo box, and the NumberOfElements property in the list box can be changed to a specific number (for example, 0).



STATUS
Microsoft is researching this behavior and will post new information in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior

 * 1) Create a new Visual FoxPro Class library based on a container control.
 * 2) Add a ListBox object to the container and right-click the ListBox object to launch the Builder.0
 * 3) Fill in the list with "Values from an array." Add an Array Name, such as "MyArray."

NOTE: In the Property sheet, select "Non-Default Properties Only" and verify the properties that have been changed.
 * 1) Click OK and save the new class.
 * 2) Create a new form and add the new class to the Forms Control toolbar.
 * 3) Attempt to add the new class to the form, and the error occurs.

NOTE: Creating the array at this point does not clear the error. In order to add the unmodified class to the form, the form must be closed and a CLEAR ALL must be issued from the Command window. To place the unmodified new class on the form, the array must be created and the form must be modified. This behavior does not occur in Visual FoxPro 3.0.

Additional query words: vfoxwin kbdse

Keywords: KB158405

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.