473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Select item in ComboBox by using arrow-keys and pressing [Enter]

Knut Ole
hi,

i have a combobox linked with a table, and have made it dropdown on keydown event. as i write, the matching alternatives will show up in the combobox, but when i move down with the arrows and press enter, the selection does not end up being the item in "focus" - but some random (?) other item. if i press the item in the dropdown box with my mouse, however, it works fine.

any ideas? thank you very much!
Apr 4 '11 #1
8 7711
NeoPa
32,556 Expert Mod 16PB
Not sure without it in front of me, but maybe the spacebar would work for actually selecting an item.
Apr 4 '11 #2
nope... what im looking for is how to code it manually, basically - is there a method for picking up whatever line is "selected" (ie. highlighted) in the combobox when i press enter, for example?
Apr 5 '11 #3
NeoPa
32,556 Expert Mod 16PB
Again, this isn't something I can help with without the item to look at and play with I'm afraid. I don't even really understand what you're after or why, but as I cannot help I won't ask for that to be posted.
Apr 7 '11 #4
to put it another way, what actually happens when you press enter in a combobox after having moved the selector-highlighter-line down a few steps in the list?
Apr 8 '11 #5
NeoPa
32,556 Expert Mod 16PB
I would normally expect the result to be the newly navigated-to value. However, this may be affected by settings on the control itself. Frankly, the only settings I would expect to affect this behaviour would be available only in a ListBox control (Multi-Select). In that situation the <space> is used to select multiple items, before submitting the selection with the <Enter>.
Apr 8 '11 #6
Rabbit
12,516 Expert Mod 8TB
Why are you manually programming the down and up arrows to choose an item in the combo box? Isn't that behavior already predefined? And therefore, wouldn't redefining it again cause it to move two spaces instead of 1?
Apr 8 '11 #7
NeoPa
32,556 Expert Mod 16PB
My understanding is that the KeyDown event is simply used to open up the ComboBox (as opposed to handling directional movement within the control when it's already open).
Apr 8 '11 #8
there was a missing end sub... what can i say.. thanks!
Apr 9 '11 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Gadrin77 | last post by:
as a newbie to XSL, is it possible to mimic a SELECT/CASE statement using XSL? I tried a quickie and I kept getting errors either using PARAM or WITH-PARAM in the wrong place or VARIABLE. I...
2
by: Stu | last post by:
Hi, I've been working on trying to use a combo box to filter my records for a while now, and can't get it to work. Right now, I have SQL code written into IfThen statements on the afterupdate for...
7
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well....
1
by: vehuel | last post by:
I have a select multiple (combobox) in a form and I need to select, using javascript, more than one item in this select. How can I do this?
6
by: x taol | last post by:
i want to change textbox to combobox type using vba. *** Sent via Developersdex http://www.developersdex.com ***
3
by: khairulfnd | last post by:
i want to select multiple rows using a checkbox in a gridview in which it will be posted in another gridview
1
by: preethiramu | last post by:
how to get the selected item by using list box in vc++?
1
by: gourab103111 | last post by:
how get multiple values from combobox using php ,when i retrive value using $_POST
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
7
by: kkshansid | last post by:
i have a table containing states and districts i want to make chain select only by using php without any java script but i m very confused how to pass variable on the same page that is as soon as...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.