|
-
May 29th, 2001, 04:53 AM
#1
How to list the items of Combo list when it get focus without click on it
Hi:
Here I have problem, I have a Combo list. If the user don't want to use mouse, and She want the Combo list list all of of it's item just like mouse click on it when she use TAB to focus on it. How can I implement this function. If anybody know about it. It will be very helpful
Millions of Thanks.
wky086
-
May 29th, 2001, 05:02 AM
#2
Re: How to list the items of Combo list when it get focus without click on it
If you want it to drop down when it has focus then your user can either hit F4 or in the gotfocus event you can put
SendKeys "{F4}"
which will automatically drop it down when it gets focus. The problem with that is that if the user uses the mouse to click on the combo then using the sendkeys will wffectivly cancel the drop down. Try it and you'll see
-
May 29th, 2001, 06:41 AM
#3
Re: How to list the items of Combo list when it get focus without click on it
Try this:
Const WM_USER = &H400
Const CB_SHOWDROPDOWN = &H14F
private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, lParam as Long) as Long
private Sub Form_Load()
Combo1.AddItem "Mt. Everest"
Combo1.AddItem "Mt. Annapurna"
Combo1.AddItem "Mt. Kilimanjaro"
End Sub
private Sub Combo1_GotFocus()
Call SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, true, 0&)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|