473,407 Members | 2,326 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,407 software developers and data experts.

ComboBox AutoComplete Issue

I have a series of ComboBox's Bound to a DataGridView and I turned the
AutoComplete on for them so they list all the items in a certain
collumn of the DataGridView.

The problem is that when you use the Tab key to finish the
Autocomplete it both selects that item and moves to the next Control
in the Tab Order.

I personally prefer to use the Enter key (to select autocomplete
items) but many users are used to the Tab key.

Know of any way I can prevent the Tab key from moving to the next
control when its used inside the Autocomplete droplist?

Thanks

May 16 '07 #1
6 7294
On Wed, 16 May 2007 14:03:35 -0700, <ez*******@gmail.comwrote:
[...]
Know of any way I can prevent the Tab key from moving to the next
control when its used inside the Autocomplete droplist?
Sounds like a feature to me. Assuming the tab key normally moves focus
between controls, why should it not also move focus when you're
autocompleting?

But, if you really want to disable this feature, it seems to me that you
could override the IsInputKey method and return true for the Tab key.

Of course, it's possible that doing so would disable the auto-complete
functionality of the Tab key. I don't have a good answer for that. :)
You might as well try it and see. It's also possible that it *won't*
disable the auto-complete functionality.

Pete
May 16 '07 #2
Have a look at creating a userControl inheriting the ComboBox and then using
the keypress event to see which key has been pressed and if it is Tab ignore.

"ez*******@gmail.com" wrote:
I have a series of ComboBox's Bound to a DataGridView and I turned the
AutoComplete on for them so they list all the items in a certain
collumn of the DataGridView.

The problem is that when you use the Tab key to finish the
Autocomplete it both selects that item and moves to the next Control
in the Tab Order.

I personally prefer to use the Enter key (to select autocomplete
items) but many users are used to the Tab key.

Know of any way I can prevent the Tab key from moving to the next
control when its used inside the Autocomplete droplist?

Thanks

May 16 '07 #3
On Wed, 16 May 2007 14:28:13 -0700, Peter Duniho
<Np*********@nnowslpianmk.comwrote:
[...]
Of course, it's possible that doing so would disable the auto-complete
functionality of the Tab key. I don't have a good answer for that. :)
You might as well try it and see. It's also possible that it *won't*
disable the auto-complete functionality.
I tried this, and it does disable the autocomplete functionality (that is,
it doesn't "complete" the autocomplete). But if you are using the
"Append" mode for the autocomplete, then just calling SelectAll() in your
override when you return true for Keys.Tab does essentially the same thing.

I haven't figured out a way to handle the autocomplete in the case when
you are using "Suggest" mode, but my guess is you could do it if you
really wanted to.

Pete
May 16 '07 #4
On Wed, 16 May 2007 14:36:02 -0700, SimonUK71
<Si*******@discussions.microsoft.comwrote:
Have a look at creating a userControl inheriting the ComboBox and then
using the keypress event to see which key has been pressed and if it is
Tab ignore.
The KeyPress event will never indicate a Tab character by default. Only
if the IsInputKey is overridden and it returns true when the Tab key is
pressed will the control get a KeyPress event for the Tab key. And of
course, by the time that happens, the original issue (the Tab key changing
focus) has been resolved, obviating any need to do additional processing
in the KeyPress event.

Pete
May 16 '07 #5

<ez*******@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
>I have a series of ComboBox's Bound to a DataGridView and I turned the
AutoComplete on for them so they list all the items in a certain
collumn of the DataGridView.

The problem is that when you use the Tab key to finish the
Autocomplete it both selects that item and moves to the next Control
in the Tab Order.

I personally prefer to use the Enter key (to select autocomplete
items) but many users are used to the Tab key.

Know of any way I can prevent the Tab key from moving to the next
control when its used inside the Autocomplete droplist?

Thanks
Doesn't the Combox have a Keypress event where you can ignore the Tab-Key
Ascii code by returning KeyAscii = 0?

May 16 '07 #6
BTW I am using SuggestAppend for the AutoComplete.

I dont want to totally kill tab for these ComboBox's. It seems like
there should be some object or Event for the AutoComplete list and I
could check for that event to be fired and if so, then override the
tab for the combo.

When you use the Intellisense AutoComplete when writing code and hit
Tab / Enter it just does the autocomplete and not the Tab / Enter
also , so you would think that should be the default behavior for most
controls, guess not.

I wish everyone would just use Enter, haha.

Oh well thanks for your help.

May 17 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: VM | last post by:
How can I implement the autocomplete functionality in a Windows comboBox? Thanks.
3
by: RajW | last post by:
Is it possible to have an auto complete ComboBox in ASP.NET? I would like to create a ComboBox that functions similarly to the way that IE will try to autocomplete a URL as you type it in. ...
19
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when...
2
by: Becker | last post by:
I have a need for a simple combobox on a form in one of my programs that represents city, state. I want to have it autocomplete as the user types. I have a table with these values (about 50k of...
2
by: Kalvin | last post by:
I found some code in Google, don't remember where, for an AutoComplete combobox. Everything is great with it except for one thing. If I use the mouse to drop the list down, then start typing to...
1
by: David Tilman | last post by:
I'm working with C# in Visual Studio 2005. I have a combobox with AutoCompleteSource = ListItems and DropDownStyle = DropDown. I want users to be able to type in the combobox and the control to...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I have to load 30,000 unique names into a combox. Filling a dataTable takes only a few milliseconds. But populating the combobox and displaying the list takes several seconds - way...
2
by: dneupane | last post by:
Hi all How can I get combobox autocomplete working with button click event, my application cannot use keyboard, so I have soft keypad. Any help would be greatly appreciated. Regards Niju
0
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi - I've been searching around for a fix but can't find one... There is a bug with combobox autocomplete suggestappend. When text has a slash, "ab/cd" for example, the autocomplete feature cuts...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.