Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Confused about combobox / listbox properties
Message
From
02/08/2002 00:54:07
 
 
To
02/08/2002 00:21:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00684277
Message ID:
00685308
Views:
25
>Alejandro,
>
>The array to be your RowSource is best a property of some object, although it can be a global variable. It can be a property of the form. It can be a property of your list if you create one in your list class you are using. You can create properties that are arrays with the [] syntax - 'ArrayProperty[]' in the box you define the property in. The ListIndex is a property, I believe it refers to the currently selected item in the List property. and honestly, even though I use lists all the time they are integrated into my class library so I fill out properties I made and put code into methods I made and these things interact with VFP's properties and methods, so I've forgotten the details. I do remember it took a bit of work to figure out. And trying to learn how to use all the various RowSourceType systems is a waste of time. If you like arrays, then use arrays, others and myself have found that's good. In my class library I put the list onto a container, so I put my array
>property on that container. In my Init in the container I fill out 8 or 10 properties I made, then I have a special method on the array that fires when record pointer changes. That special method fills out the array. When user double clicks on an item an editing container comes up. It took a long time to build, but now it is a snap to program in. I also don't use combo boxes any more because I made a container with textbox and push button in it to use as a lookup type object.
>

Arrays and cursors for record sources seem most practical.

Where to keep the array... Form property seemed OK, but I found myself creating another property to be the list control source. Perhaps this is what ListIndex is for... Making array a property of the list/combobox itself has a pleasing "encapsulated" feeling to it, but what if you have to access or refill the array from somewhere else and the list is in some page and sometimes you move it around...

Thank you for your suggestions. Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform