Link to home
Start Free TrialLog in
Avatar of fmoore0001
fmoore0001

asked on

Need a Drop Down Box

I ran into a Foxpo limitation that I cannot seen to get around.   I need a DROPDOWN list box, something like a combination of Listbox and Combobox, or way to set either up accordingly.

I need the box to display the currnetly selected item in the box, which, in turn, is column 1 of the array that is supply data.  The only items that can be selected are the ones in the list.  No data entry is allowed.  So, anyone got any ideas.
ASKER CERTIFIED SOLUTION
Avatar of tusharkanvinde
tusharkanvinde
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fmoore0001
fmoore0001

ASKER

okay tusharkanvinde, that was it!!

One last question. Any way to get both columns to display in the box, even though I only want column to store data?
Ah!  And another thing, if I enter values, I get two columns, but if I use an Array, I get only the second column.  More to these things than I thought.
There is a columncount property and a columnwidths property. ColumnWidths will have a comma separated list of widths of each column.
Avatar of Olaf Doschke
In the closed state the combobox will only display the first column anyway. So you better have some expression concatenating what you want to display in the closed state for the first column, then set columnwidth to "0,....", so that this first summary column is not visible while the combobox is dropped down. And put an ID or key value you want to bind to in another column, perhaps the last one rather than the first one (which is reserverd for the summray of course), so you also end the columnwidth with 0 to not display that internal only key value.

simple example:

personID, lastname, firstname

populate the array with rtrim(lastname)+', '#rtrim(firstname),lastname,firstname,personID for each row
with columnwidth set to"0,100,100,0"

Bye, Olaf.
Guys, thanks for the input.

Tusharkanvinde, you got me on the right track.  Alot more to combo boxes then I expected!

Olaf,, I could not get the display to ever work showing the column the way I would like.  The problem is that I am dealing with Fannie Mae codes for submission files, government which themselves may only two or three characters for a complicated description.  I was able to show the first descriptions with a combination of VALUE and ARRAY selections, but since column is the only one that matters for data submission the second column just seems to be beyond my reach.  Too bad.  An improvement will not happen for Foxpro.
You know, I wonder if some makes a replacement for the Foxpro combo box as an Active X contol?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, guys