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:
00616111
Views:
21
Update #3: Found it -- DisplayCount

Update #2: OK, now I am confused. I got the NumberOfElements to display just 2 based on your example, but I thought I could then scroll down to the last 3. I can only select from the first 2. This is not what I want.

This combo is toward the bottom of the form and the dropdown list covers part of the Save and Cancel buttons. I want to limit the size of the list without sacrificing the number of items available for selection. Sheeze!

Update: Click! The light went on. The ColumnCOunt has to be 1, but the array can still be multi-dimensional. This still sucks for the combos where I have to have a 3-D array -- TypeCode, Descript, KeyID. I guess I can live with just showing them the Descript.

-----------

Hmmm, that is exactly what I have. I issue:

select descript, keyid from lookup_table order by descript into array This.aList

My RowSourceType=5, and Rowsource='This.aList'. I also have NumberOfElements set to 5, but no go. I have also tried your exact code, and I get all 5 choices in the list. Are you using VFP7SP1? If not maybe this has been broken to match what the help file says. :(

>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 >
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform