473,756 Members | 5,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Knut Ole
70 New Member
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 7771
NeoPa
32,572 Recognized Expert Moderator MVP
Not sure without it in front of me, but maybe the spacebar would work for actually selecting an item.
Apr 4 '11 #2
Knut Ole
70 New Member
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,572 Recognized Expert Moderator MVP
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
Knut Ole
70 New Member
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,572 Recognized Expert Moderator MVP
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 Recognized Expert Moderator MVP
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,572 Recognized Expert Moderator MVP
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
Knut Ole
70 New Member
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
10953
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 ended up using .createProcessor and doing all the work behind the scenes in my programming language, then using the
2
3165
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 the combobox. I tried using the docmd.runSQL but from looking at previous posts, it seems that I need to use DoCmd.OpenQuery instead since I do not have an action SQL statement. The short term problem is that when the user selects from the...
7
20770
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. The control populates well, both the display values, and selected values. However, when i try to "set" the SelectedValue or SelectedIndex properties, nothing happens.... The default blank value in the ComboBox is always selected. My code is: ...
1
5064
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
2162
by: x taol | last post by:
i want to change textbox to combobox type using vba. *** Sent via Developersdex http://www.developersdex.com ***
3
1897
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
2364
by: preethiramu | last post by:
how to get the selected item by using list box in vc++?
1
3388
by: gourab103111 | last post by:
how get multiple values from combobox using php ,when i retrive value using $_POST
1
4030
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 are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
7
2739
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 user select particular state its districts get loaded from database to the registration form
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.