By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Basic ComboBox question

P: n/a
Hi,

I have a ComboBox that contains 1,400 sorted items [don't ask,
management decision :(]. Here's the list:

abba
apple
[...lots of items]...
cabba
caccaa
capple
czar
[...lots of items]...
pheasentHeadOfDeath

Let's say the user is trying to select "capple". The natural thing to do
is to dropdown the listbox and type the first few letters of the item's
name. So the user might type "cap." The behavior is as follows: When the
user hits 'c', 'caba' is selected then the user immediately hits 'a' at
which point 'abba' is selected and then the user hits 'p' and
'pheasentHeadOfDeath' is selected. Is there a way to get the ComboBox to
realize that the user is trying to spell a word and highlight the first item
that begins with 'cap'? If this user waits more than x seconds between
keystrokes, the comboBox would realize that he's searching for a new item. I
can think of ways to program this manually, but I wanted to make sure that
this type of thing wasn't already built into the ComboBox via some sort of
"ComboBoxUnderstandsKeystrokesAsWords" property or something.

David
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The ComboBox does not have this functionality built in, so you'll have to do
something yourself. See the Genghis CompletionCombo from Sells Brothers for
an example if you want to write your own, or you can use the Genghis's dll
for free if you want:
http://www.sellsbrothers.com/tools/genghis/
"David Sworder" <ds******@cts.com> wrote in message
news:uG**************@tk2msftngp13.phx.gbl...
Hi,

I have a ComboBox that contains 1,400 sorted items [don't ask,
management decision :(]. Here's the list:

abba
apple
[...lots of items]...
cabba
caccaa
capple
czar
[...lots of items]...
pheasentHeadOfDeath

Let's say the user is trying to select "capple". The natural thing to do is to dropdown the listbox and type the first few letters of the item's
name. So the user might type "cap." The behavior is as follows: When the
user hits 'c', 'caba' is selected then the user immediately hits 'a' at
which point 'abba' is selected and then the user hits 'p' and
'pheasentHeadOfDeath' is selected. Is there a way to get the ComboBox to
realize that the user is trying to spell a word and highlight the first item that begins with 'cap'? If this user waits more than x seconds between
keystrokes, the comboBox would realize that he's searching for a new item. I can think of ways to program this manually, but I wanted to make sure that
this type of thing wasn't already built into the ComboBox via some sort of
"ComboBoxUnderstandsKeystrokesAsWords" property or something.

David

Nov 15 '05 #2

P: n/a
The ComboBox does not have this functionality built in, so you'll have to do
something yourself. See the Genghis CompletionCombo from Sells Brothers for
an example if you want to write your own, or you can use the Genghis's dll
for free if you want:
http://www.sellsbrothers.com/tools/genghis/
"David Sworder" <ds******@cts.com> wrote in message
news:uG**************@tk2msftngp13.phx.gbl...
Hi,

I have a ComboBox that contains 1,400 sorted items [don't ask,
management decision :(]. Here's the list:

abba
apple
[...lots of items]...
cabba
caccaa
capple
czar
[...lots of items]...
pheasentHeadOfDeath

Let's say the user is trying to select "capple". The natural thing to do is to dropdown the listbox and type the first few letters of the item's
name. So the user might type "cap." The behavior is as follows: When the
user hits 'c', 'caba' is selected then the user immediately hits 'a' at
which point 'abba' is selected and then the user hits 'p' and
'pheasentHeadOfDeath' is selected. Is there a way to get the ComboBox to
realize that the user is trying to spell a word and highlight the first item that begins with 'cap'? If this user waits more than x seconds between
keystrokes, the comboBox would realize that he's searching for a new item. I can think of ways to program this manually, but I wanted to make sure that
this type of thing wasn't already built into the ComboBox via some sort of
"ComboBoxUnderstandsKeystrokesAsWords" property or something.

David

Nov 15 '05 #3

P: n/a

Hi David,

Thank you for posting in this group.

The ComboBox control does not contain such function.
I think you should create a custom control inherited from the ComboBox,
then you can apply your program logic in your class.

For example, you can handle the ComboBox_TextChanged event, select relevant
element while the customer typing.(But you should set the appropriate
charaters focus of the text).

If you still have any questions, please feel free to let me know.
Hope this helps,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "David Sworder" <ds******@cts.com>
| Subject: Basic ComboBox question
| Date: Fri, 3 Oct 2003 11:10:12 -0700
| Lines: 31
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uG**************@tk2msftngp13.phx.gbl>
| Newsgroups:
microsoft.public.dotnet.framework.windowsforms,mic rosoft.public.dotnet.langu
ages.csharp
| NNTP-Posting-Host: rrcs-west-66-27-51-213.biz.rr.com 66.27.51.213
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.csharp:188822
microsoft.public.dotnet.framework.windowsforms:537 02
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I have a ComboBox that contains 1,400 sorted items [don't ask,
| management decision :(]. Here's the list:
|
| abba
| apple
| [...lots of items]...
| cabba
| caccaa
| capple
| czar
| [...lots of items]...
| pheasentHeadOfDeath
|
| Let's say the user is trying to select "capple". The natural thing to
do
| is to dropdown the listbox and type the first few letters of the item's
| name. So the user might type "cap." The behavior is as follows: When the
| user hits 'c', 'caba' is selected then the user immediately hits 'a' at
| which point 'abba' is selected and then the user hits 'p' and
| 'pheasentHeadOfDeath' is selected. Is there a way to get the ComboBox to
| realize that the user is trying to spell a word and highlight the first
item
| that begins with 'cap'? If this user waits more than x seconds between
| keystrokes, the comboBox would realize that he's searching for a new
item. I
| can think of ways to program this manually, but I wanted to make sure that
| this type of thing wasn't already built into the ComboBox via some sort of
| "ComboBoxUnderstandsKeystrokesAsWords" property or something.
|
| David
|
|
|

Nov 15 '05 #4

P: n/a

Hi David,

Thank you for posting in this group.

The ComboBox control does not contain such function.
I think you should create a custom control inherited from the ComboBox,
then you can apply your program logic in your class.

For example, you can handle the ComboBox_TextChanged event, select relevant
element while the customer typing.(But you should set the appropriate
charaters focus of the text).

If you still have any questions, please feel free to let me know.
Hope this helps,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "David Sworder" <ds******@cts.com>
| Subject: Basic ComboBox question
| Date: Fri, 3 Oct 2003 11:10:12 -0700
| Lines: 31
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uG**************@tk2msftngp13.phx.gbl>
| Newsgroups:
microsoft.public.dotnet.framework.windowsforms,mic rosoft.public.dotnet.langu
ages.csharp
| NNTP-Posting-Host: rrcs-west-66-27-51-213.biz.rr.com 66.27.51.213
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.csharp:188822
microsoft.public.dotnet.framework.windowsforms:537 02
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I have a ComboBox that contains 1,400 sorted items [don't ask,
| management decision :(]. Here's the list:
|
| abba
| apple
| [...lots of items]...
| cabba
| caccaa
| capple
| czar
| [...lots of items]...
| pheasentHeadOfDeath
|
| Let's say the user is trying to select "capple". The natural thing to
do
| is to dropdown the listbox and type the first few letters of the item's
| name. So the user might type "cap." The behavior is as follows: When the
| user hits 'c', 'caba' is selected then the user immediately hits 'a' at
| which point 'abba' is selected and then the user hits 'p' and
| 'pheasentHeadOfDeath' is selected. Is there a way to get the ComboBox to
| realize that the user is trying to spell a word and highlight the first
item
| that begins with 'cap'? If this user waits more than x seconds between
| keystrokes, the comboBox would realize that he's searching for a new
item. I
| can think of ways to program this manually, but I wanted to make sure that
| this type of thing wasn't already built into the ComboBox via some sort of
| "ComboBoxUnderstandsKeystrokesAsWords" property or something.
|
| David
|
|
|

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.