Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox control
Message
 
To
18/11/2002 09:08:42
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00723810
Message ID:
00723821
Views:
16
>Hello all,
> I am developing a custom combobox control. When the user presses ENTER the combobox will match the characters entered in the box with record(s) in the database and then bind the combobox with the resulting cursor. Currently I have 3 problems.
>
>When the user presses the ENTER key, my query executes, but Focus goes to the next control. How can I keep FOCUS on the combobox?
>
>Secondly, when the user presses the UP and DOWN arrow keys, I want to move through the cursor. By putting code in the KEY PRESS event I can make this happen, but Focus goes to the next control each time the UP or DOWN arrow key is pressed. So I need to keep FOCUS on the control again.
>
>Third, once the query executes, I would like to programmatically drop down the combobox list. How can this be done? This may actually solve the second problem, because the UP and DOWN arrows keys work properly when the combobox is in the drop down mode.
>
>
>The way this control works. The user is allowed to search on 3 fields or a combination there of. The fields are designated by certain keys, like to search on the second field - a comma must be entered pre data. A dash must be entered pre data before the third field. The fields can be of character type, integer numeric type, or date type. Once I get it working properly, I would be happy to let others use it. Thanks for the help.

To keep the focus on combobox you can place conditional NODEFAULT command into combo.LostFocus() event: for example for pressing Enter that would be:
*** combo.LostFocus()
IF LASTKEY() = 13
	NODEFAULT
ENDIF
To programmatically drop down the combobox list you may use
KEYBOARD "{F4}"
or
KEYBOARD "{ALT + DNARROW}"
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform