Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo NumberOfElements
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00616066
Message ID:
00616099
Views:
17
Strange: I dropped a combo on a form, set the rowsource to this.alist and put the following in the init:
this.AddProperty("aList[1]")
Dimension aTest[5, 2]
atest[1, 1] = "abc"
atest[1, 2] = 1
atest[2, 1] = "bcd"
atest[2, 2] = 2
atest[3, 1] = "cde"
atest[3, 2] = 3
atest[4, 1] = "def"
atest[4, 2] = 4
atest[5, 1] = "efg"
atest[5, 2] = 5
 
Acopy(atest,this.alist)
this.RowSourceType = 5
this.NumberOfElements = 2
When I click the combo arrow there are only 2 items in the list. Based on what you posted, that shouldn't happen right?

>VFP7SP1. I have a combo class that retrieves records from lookup tables into an array. I am trying to limit the drop down list to 5 items by setting the NumberOfElements to 5. This property shows the correct value of 5 in the debugger, but the list always shows 7 items. My next illogical step was to set the NumberOfElements to 3 hoping to get to 5. Nope. I still get 7 listed. Am I missing something? TIA!
>
>Update: Crap! We are limited to a ColumnCount of 1. So this only works if the value I want to store in the ControlSource is the lookup description instead of the PK. I guess I could just list the PK of the lookup values in the combo and let the users guess which PK to select. THIS IS WORTHLESS!!!!!!!!!!!!!!!!! < SET RANT OFF >
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform