473,836 Members | 1,261 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 7780
NeoPa
32,584 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,584 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,584 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,584 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
10959
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
3169
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
20773
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
5069
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
2166
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
2369
by: preethiramu | last post by:
how to get the selected item by using list box in vc++?
1
3390
by: gourab103111 | last post by:
how get multiple values from combobox using php ,when i retrive value using $_POST
1
4035
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
2743
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
9813
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
9661
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10831
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
10536
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...
1
7778
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6976
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
5645
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5815
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.