Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box opening mid list
Message
From
15/10/2010 14:41:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
14/10/2010 10:50:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01485471
Message ID:
01485640
Views:
32
>>>In a combo box with RowSourceType set to 5 (array), array sorted in a user-specified order, not necessarily alphabetical, bound to a data field; when opened on an empty data field is there any way to force the list to open at the top of the list instead of the middle or bottom as it sometimes does now?
>>
>>Not tested, but I guess you can add some conditional code to GotFocus, like
>>If empty(yourfield)
>>   KEYBOARD "{Home}" PLAIN CLEAR 
>>endif
>
>That works, but has the unfortunate side effect of selecting the first choice in the list as soon as you tab or click into the field. It also seems to eat the first mouse click and requires a second click to open the list.
>
>Putting the same code in the DropDown event works very nicely; thanks for the idea.

But do that only if the .displayvalue is empty; if it's not, maybe some location related to the value would be better ("equal to" is also a relation :). I think it's possible for a user who drops the combo and has the mouse in the dropdown area to inadvertently select a value they didn't want - and your forcing of the selection to top may lead to a similar effect. YMMV.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform