473,387 Members | 1,542 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,387 software developers and data experts.

combobox autocomplete - DROPDOWNLIST

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 you look at combobox controls
from years ago, they would autocomplete in dropdownlist mode. And if you
look at intellisense, this is exactly what happens, so obviously the .net
framework can do it.

Any help would be much appreciated.

Bernie Yaeger
Nov 21 '05 #1
19 18276
Hi,

http://www.thecodeproject.com/vb/net...e_combobox.asp

Ken
---------------------
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:ux*************@TK2MSFTNGP11.phx.gbl...
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 you look at combobox controls
from years ago, they would autocomplete in dropdownlist mode. And if you
look at intellisense, this is exactly what happens, so obviously the .net
framework can do it.

Any help would be much appreciated.

Bernie Yaeger

Nov 21 '05 #2
Hi Ken,

You are easily one of the most knowledgeable and helpful people on this ng.
So it is that much more disappointing that you didn't read what I said -
THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!

Bernie

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
Hi,

http://www.thecodeproject.com/vb/net...e_combobox.asp

Ken
---------------------
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:ux*************@TK2MSFTNGP11.phx.gbl...
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 you look at combobox
controls
from years ago, they would autocomplete in dropdownlist mode. And if you
look at intellisense, this is exactly what happens, so obviously the .net
framework can do it.

Any help would be much appreciated.

Bernie Yaeger

Nov 21 '05 #3
Bernie,
You are easily one of the most knowledgeable and helpful people on this
ng. So it is that much more disappointing that you didn't read what I
said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!


If I understand you well, why than not make it your own by setting it in
combobox mode and doing a findstringexact when the user has selected an
item.

When it is not already in the combobox you can just ignore it, or even
ignore it with a message.

Maybe this helps, just a try?

Cor
Nov 21 '05 #4
Hi Cor,

Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and stay on
'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to 'complete'.

This is the way dropdownlist comboboxes used to work - for at least the last
10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl...
Bernie,
You are easily one of the most knowledgeable and helpful people on this
ng. So it is that much more disappointing that you didn't read what I
said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!


If I understand you well, why than not make it your own by setting it in
combobox mode and doing a findstringexact when the user has selected an
item.

When it is not already in the combobox you can just ignore it, or even
ignore it with a message.

Maybe this helps, just a try?

Cor

Nov 21 '05 #5
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken has
showed you.

The difference between a combobox and a listbox is that you may enter and
use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with findstringexact

Cor

Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and stay
on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to
'complete'.

This is the way dropdownlist comboboxes used to work - for at least the
last 10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl...
Bernie,
You are easily one of the most knowledgeable and helpful people on this
ng. So it is that much more disappointing that you didn't read what I
said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!


If I understand you well, why than not make it your own by setting it in
combobox mode and doing a findstringexact when the user has selected an
item.

When it is not already in the combobox you can just ignore it, or even
ignore it with a message.

Maybe this helps, just a try?

Cor


Nov 21 '05 #6
Hi Cor,

There are lots of differences between a listbox and a combobox. But the
point is, in a combobox in dropdowlist mode, you cannot enter text - every
keystroke simply searches for the item that matches. By default, when in
dropdownlist mode, it simply finds the first item with the same initial
letter:

common
olive
call
complete

Entering a 'c' will find 'call', because it is first, alphabetically; then
entering an 'o' will find 'olive', etc. What I want - and what we had for
years - is for the user to enter 'c' and get call, but then enter 'o' and
get 'common', not 'olive'.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken
has showed you.

The difference between a combobox and a listbox is that you may enter and
use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with findstringexact

Cor

Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and stay
on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to
'complete'.

This is the way dropdownlist comboboxes used to work - for at least the
last 10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl...
Bernie,

You are easily one of the most knowledgeable and helpful people on this
ng. So it is that much more disappointing that you didn't read what I
said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!

If I understand you well, why than not make it your own by setting it in
combobox mode and doing a findstringexact when the user has selected an
item.

When it is not already in the combobox you can just ignore it, or even
ignore it with a message.

Maybe this helps, just a try?

Cor



Nov 21 '05 #7
Bernie,

I did write the wrong word, should have been combobox in dropdowlist mode
instead of listbox, however again, does that sample Ken showed you not do
that?

And than again, with the idea I added to that.

Cor

"Bernie Yaeger" <be*****@cherwellinc.com>
Hi Cor,

There are lots of differences between a listbox and a combobox. But the
point is, in a combobox in dropdowlist mode, you cannot enter text - every
keystroke simply searches for the item that matches. By default, when in
dropdownlist mode, it simply finds the first item with the same initial
letter:

common
olive
call
complete

Entering a 'c' will find 'call', because it is first, alphabetically; then
entering an 'o' will find 'olive', etc. What I want - and what we had for
years - is for the user to enter 'c' and get call, but then enter 'o' and
get 'common', not 'olive'.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken
has showed you.

The difference between a combobox and a listbox is that you may enter and
use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with findstringexact

Cor

Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and
stay on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to
'complete'.

This is the way dropdownlist comboboxes used to work - for at least the
last 10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl...
Bernie,

> You are easily one of the most knowledgeable and helpful people on
> this ng. So it is that much more disappointing that you didn't read
> what I said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!

If I understand you well, why than not make it your own by setting it
in combobox mode and doing a findstringexact when the user has selected
an item.

When it is not already in the combobox you can just ignore it, or even
ignore it with a message.

Maybe this helps, just a try?

Cor



Nov 21 '05 #8
Bernie,

I know exactly what you want and why you want it, and no the example he
gave is not it. However, if you subclass it, and then grab the keydown
event and build your own string while the control has focus, you could
probably do some sort of manual find on it to get the one they want. I
will need this as well once I get more of my current project completed...

Aaron

Cor Ligthert wrote:
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken has
showed you.

The difference between a combobox and a listbox is that you may enter and
use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with findstringexact

Cor

Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and stay
on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to
'complete'.

This is the way dropdownlist comboboxes used to work - for at least the
last 10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl...
Bernie,
You are easily one of the most knowledgeable and helpful people on this
ng. So it is that much more disappointing that you didn't read what I
said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!

If I understand you well, why than not make it your own by setting it in
combobox mode and doing a findstringexact when the user has selected an
item.

When it is not already in the combobox you can just ignore it, or even
ignore it with a message.

Maybe this helps, just a try?

Cor



--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.
Nov 21 '05 #9
Hi Aaron,

Tx for restoring my sanity!

Actually, I have already played around with the idea of using a global
string, exiting in the keyup event when tab, enter, arrows, etc and the
findstring with the global string. I then added a timer so that the global
string is cleared after a 2 second interval (so if you enter 'com' and wait
too long, 'p' with start again and find, say, 'paper'), because if you don't
clear the string the user can't make a second selection.

I may try to develop this into a custom control. If I do, I will email you
and let you know what I've done.

Bernie

"Aaron Smith" <th**********@smithcentral.net> wrote in message
news:O%*******************@newssvr33.news.prodigy. com...
Bernie,

I know exactly what you want and why you want it, and no the example he
gave is not it. However, if you subclass it, and then grab the keydown
event and build your own string while the control has focus, you could
probably do some sort of manual find on it to get the one they want. I
will need this as well once I get more of my current project completed...

Aaron

Cor Ligthert wrote:
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken
has showed you.

The difference between a combobox and a listbox is that you may enter and
use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with findstringexact

Cor

Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and stay
on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to
'complete'.

This is the way dropdownlist comboboxes used to work - for at least the
last 10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl...

Bernie,
>You are easily one of the most knowledgeable and helpful people on this
>ng. So it is that much more disappointing that you didn't read what I
>said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!

If I understand you well, why than not make it your own by setting it in
combobox mode and doing a findstringexact when the user has selected an
item.

When it is not already in the combobox you can just ignore it, or even
ignore it with a message.

Maybe this helps, just a try?

Cor


--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.

Nov 21 '05 #10
That would be awesome!

Bernie Yaeger wrote:
Hi Aaron,

Tx for restoring my sanity!

Actually, I have already played around with the idea of using a global
string, exiting in the keyup event when tab, enter, arrows, etc and the
findstring with the global string. I then added a timer so that the global
string is cleared after a 2 second interval (so if you enter 'com' and wait
too long, 'p' with start again and find, say, 'paper'), because if you don't
clear the string the user can't make a second selection.

I may try to develop this into a custom control. If I do, I will email you
and let you know what I've done.

Bernie

"Aaron Smith" <th**********@smithcentral.net> wrote in message
news:O%*******************@newssvr33.news.prodigy. com...
Bernie,

I know exactly what you want and why you want it, and no the example he
gave is not it. However, if you subclass it, and then grab the keydown
event and build your own string while the control has focus, you could
probably do some sort of manual find on it to get the one they want. I
will need this as well once I get more of my current project completed...

Aaron

Cor Ligthert wrote:
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken
has showed you.

The difference between a combobox and a listbox is that you may enter and
use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with findstringexact

Cor

Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and stay
on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to
'complete'.

This is the way dropdownlist comboboxes used to work - for at least the
last 10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl.. .
>Bernie,
>
>
>
>>You are easily one of the most knowledgeable and helpful people on this
>>ng. So it is that much more disappointing that you didn't read what I
>>said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!
>
>If I understand you well, why than not make it your own by setting it in
>combobox mode and doing a findstringexact when the user has selected an
>item.
>
>When it is not already in the combobox you can just ignore it, or even
>ignore it with a message.
>
>Maybe this helps, just a try?
>
>Cor
>
>


--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.


--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.
Nov 21 '05 #11
Hi Cor,

No; his suggestion only works for cropdown, not dropdownlist, comboboxes.
Your suggestion would not sequentially find, as findstringexact would not
begin the match until it was fully entered.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
Bernie,

I did write the wrong word, should have been combobox in dropdowlist mode
instead of listbox, however again, does that sample Ken showed you not do
that?

And than again, with the idea I added to that.

Cor

"Bernie Yaeger" <be*****@cherwellinc.com>
Hi Cor,

There are lots of differences between a listbox and a combobox. But the
point is, in a combobox in dropdowlist mode, you cannot enter text -
every keystroke simply searches for the item that matches. By default,
when in dropdownlist mode, it simply finds the first item with the same
initial letter:

common
olive
call
complete

Entering a 'c' will find 'call', because it is first, alphabetically;
then entering an 'o' will find 'olive', etc. What I want - and what we
had for years - is for the user to enter 'c' and get call, but then enter
'o' and get 'common', not 'olive'.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken
has showed you.

The difference between a combobox and a listbox is that you may enter
and use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with
findstringexact

Cor
Findstringexact won't solve the problem.

Let's say the combobox contains

twist
soccer player
coral
comment
complete

What the user wants is to enter 'c' and get 'comment'; enter 'o' and
stay on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go to
'complete'.

This is the way dropdownlist comboboxes used to work - for at least the
last 10 years before .net.

Thanks for any help.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uU**************@TK2MSFTNGP15.phx.gbl...
> Bernie,
>
>> You are easily one of the most knowledgeable and helpful people on
>> this ng. So it is that much more disappointing that you didn't read
>> what I said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!
>
> If I understand you well, why than not make it your own by setting it
> in combobox mode and doing a findstringexact when the user has
> selected an item.
>
> When it is not already in the combobox you can just ignore it, or even
> ignore it with a message.
>
> Maybe this helps, just a try?
>
> Cor
>
>



Nov 21 '05 #12
Bernie,

Now I understand where we misunderstand each other, I was talking after that
the complete filling was done, while you are talking doing it.

Cor

No; his suggestion only works for cropdown, not dropdownlist, comboboxes.
Your suggestion would not sequentially find, as findstringexact would not
begin the match until it was fully entered.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
Bernie,

I did write the wrong word, should have been combobox in dropdowlist mode
instead of listbox, however again, does that sample Ken showed you not do
that?

And than again, with the idea I added to that.

Cor

"Bernie Yaeger" <be*****@cherwellinc.com>
Hi Cor,

There are lots of differences between a listbox and a combobox. But the
point is, in a combobox in dropdowlist mode, you cannot enter text -
every keystroke simply searches for the item that matches. By default,
when in dropdownlist mode, it simply finds the first item with the same
initial letter:

common
olive
call
complete

Entering a 'c' will find 'call', because it is first, alphabetically;
then entering an 'o' will find 'olive', etc. What I want - and what we
had for years - is for the user to enter 'c' and get call, but then
enter 'o' and get 'common', not 'olive'.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Bernie,

That is what in my opinion that autocomplete combobox would do what Ken
has showed you.

The difference between a combobox and a listbox is that you may enter
and use text in a combobox that is not in the listcontrol.

Therefore I came with that idea about checking first with
findstringexact

Cor

>
> Findstringexact won't solve the problem.
>
> Let's say the combobox contains
>
> twist
> soccer player
> coral
> comment
> complete
>
> What the user wants is to enter 'c' and get 'comment'; enter 'o' and
> stay on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go
> to 'complete'.
>
> This is the way dropdownlist comboboxes used to work - for at least
> the last 10 years before .net.
>
> Thanks for any help.
>
> Bernie
>
> "Cor Ligthert" <no************@planet.nl> wrote in message
> news:uU**************@TK2MSFTNGP15.phx.gbl...
>> Bernie,
>>
>>> You are easily one of the most knowledgeable and helpful people on
>>> this ng. So it is that much more disappointing that you didn't read
>>> what I said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!
>>
>> If I understand you well, why than not make it your own by setting it
>> in combobox mode and doing a findstringexact when the user has
>> selected an item.
>>
>> When it is not already in the combobox you can just ignore it, or
>> even ignore it with a message.
>>
>> Maybe this helps, just a try?
>>
>> Cor
>>
>>
>
>



Nov 21 '05 #13
Hi Cor,

Yes, exactly. I am testing using findstring against a global string. Let
know if you have any ideas that might help. Tx.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:e2**************@TK2MSFTNGP11.phx.gbl...
Bernie,

Now I understand where we misunderstand each other, I was talking after
that the complete filling was done, while you are talking doing it.

Cor

No; his suggestion only works for cropdown, not dropdownlist, comboboxes.
Your suggestion would not sequentially find, as findstringexact would not
begin the match until it was fully entered.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eQ**************@TK2MSFTNGP10.phx.gbl...
Bernie,

I did write the wrong word, should have been combobox in dropdowlist
mode instead of listbox, however again, does that sample Ken showed you
not do that?

And than again, with the idea I added to that.

Cor

"Bernie Yaeger" <be*****@cherwellinc.com>
Hi Cor,

There are lots of differences between a listbox and a combobox. But
the point is, in a combobox in dropdowlist mode, you cannot enter
text - every keystroke simply searches for the item that matches. By
default, when in dropdownlist mode, it simply finds the first item with
the same initial letter:

common
olive
call
complete

Entering a 'c' will find 'call', because it is first, alphabetically;
then entering an 'o' will find 'olive', etc. What I want - and what we
had for years - is for the user to enter 'c' and get call, but then
enter 'o' and get 'common', not 'olive'.

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
> Bernie,
>
> That is what in my opinion that autocomplete combobox would do what
> Ken has showed you.
>
> The difference between a combobox and a listbox is that you may enter
> and use text in a combobox that is not in the listcontrol.
>
> Therefore I came with that idea about checking first with
> findstringexact
>
> Cor
>
>>
>> Findstringexact won't solve the problem.
>>
>> Let's say the combobox contains
>>
>> twist
>> soccer player
>> coral
>> comment
>> complete
>>
>> What the user wants is to enter 'c' and get 'comment'; enter 'o' and
>> stay on 'comment'; enter 'm' and stay on 'comment'; enter 'p' and go
>> to 'complete'.
>>
>> This is the way dropdownlist comboboxes used to work - for at least
>> the last 10 years before .net.
>>
>> Thanks for any help.
>>
>> Bernie
>>
>> "Cor Ligthert" <no************@planet.nl> wrote in message
>> news:uU**************@TK2MSFTNGP15.phx.gbl...
>>> Bernie,
>>>
>>>> You are easily one of the most knowledgeable and helpful people on
>>>> this ng. So it is that much more disappointing that you didn't read
>>>> what I said - THIS DOESN'T WORK WITH A DROPDOWNLIST COMBOBOX!
>>>
>>> If I understand you well, why than not make it your own by setting
>>> it in combobox mode and doing a findstringexact when the user has
>>> selected an item.
>>>
>>> When it is not already in the combobox you can just ignore it, or
>>> even ignore it with a message.
>>>
>>> Maybe this helps, just a try?
>>>
>>> Cor
>>>
>>>
>>
>>
>
>



Nov 21 '05 #14
Bernie,

To give me the idea, can you try if this is what you mean, you have to set
the combobox to the normal dropdown however set that dropdownliststyle to
true. I did not test it real deep, hower got the idea that it was working.

\\\
Private DropDownListStyle As Boolean
Private Sub combobox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
Dim cbo As ComboBox = DirectCast(sender, ComboBox)
Select Case e.KeyCode
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete,
Keys.Down
Return
End Select
Dim ComboBoxText As String = cbo.Text
Dim FirstFound As Integer = cbo.FindString(ComboBoxText)
If FirstFound >= 0 Then
Dim FirstFoundItem As Object = cbo.Items(FirstFound)
Dim FirstFoundText As String = cbo.GetItemText(FirstFoundItem)
cbo.Text = FirstFoundText
cbo.SelectionStart = ComboBoxText.Length
cbo.SelectionLength = cbo.Text.Length
Else
If DropDownListStyle = True Then
cbo.Text = cbo.Text.Substring(0, cbo.Text.Length - 1)
cbo.SelectionStart = cbo.Text.Length
End If
End If
End Sub
///

I hope we reach the idea?

Cor
Nov 21 '05 #15
Hi Cor,

There is only the dropdownstyle property, and it is not a boolean; rather it
sets to dropdown, dorpdownlist, etc. Is there a boolean property that I
can't see?

Tx

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
Bernie,

To give me the idea, can you try if this is what you mean, you have to set
the combobox to the normal dropdown however set that dropdownliststyle to
true. I did not test it real deep, hower got the idea that it was working.

\\\
Private DropDownListStyle As Boolean
Private Sub combobox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
Dim cbo As ComboBox = DirectCast(sender, ComboBox)
Select Case e.KeyCode
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete,
Keys.Down
Return
End Select
Dim ComboBoxText As String = cbo.Text
Dim FirstFound As Integer = cbo.FindString(ComboBoxText)
If FirstFound >= 0 Then
Dim FirstFoundItem As Object = cbo.Items(FirstFound)
Dim FirstFoundText As String = cbo.GetItemText(FirstFoundItem)
cbo.Text = FirstFoundText
cbo.SelectionStart = ComboBoxText.Length
cbo.SelectionLength = cbo.Text.Length
Else
If DropDownListStyle = True Then
cbo.Text = cbo.Text.Substring(0, cbo.Text.Length - 1)
cbo.SelectionStart = cbo.Text.Length
End If
End If
End Sub
///

I hope we reach the idea?

Cor

Nov 21 '05 #16
Private DropDownListStyle As Boolean

In the top of my sample, when you use it as dropdownlist direct you cannot
enter keystrokes and it is so simple that making an inheritted combobox
seems too me a little bit overdone for that. I am thinking on another simple
improvement when it fits you.

Cor.

"Bernie Yaeger" <be*****@cherwellinc.com> schreef in bericht
news:eB**************@TK2MSFTNGP11.phx.gbl...
Hi Cor,

There is only the dropdownstyle property, and it is not a boolean; rather
it sets to dropdown, dorpdownlist, etc. Is there a boolean property that
I can't see?

Tx

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
Bernie,

To give me the idea, can you try if this is what you mean, you have to
set the combobox to the normal dropdown however set that
dropdownliststyle to true. I did not test it real deep, hower got the
idea that it was working.

\\\
Private DropDownListStyle As Boolean
Private Sub combobox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
Dim cbo As ComboBox = DirectCast(sender, ComboBox)
Select Case e.KeyCode
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete,
Keys.Down
Return
End Select
Dim ComboBoxText As String = cbo.Text
Dim FirstFound As Integer = cbo.FindString(ComboBoxText)
If FirstFound >= 0 Then
Dim FirstFoundItem As Object = cbo.Items(FirstFound)
Dim FirstFoundText As String = cbo.GetItemText(FirstFoundItem)
cbo.Text = FirstFoundText
cbo.SelectionStart = ComboBoxText.Length
cbo.SelectionLength = cbo.Text.Length
Else
If DropDownListStyle = True Then
cbo.Text = cbo.Text.Substring(0, cbo.Text.Length - 1)
cbo.SelectionStart = cbo.Text.Length
End If
End If
End Sub
///

I hope we reach the idea?

Cor


Nov 21 '05 #17
Hi Cor,

Yes, you are correct - your sample works fine! Thanks so much!

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
Private DropDownListStyle As Boolean

In the top of my sample, when you use it as dropdownlist direct you cannot
enter keystrokes and it is so simple that making an inheritted combobox
seems too me a little bit overdone for that. I am thinking on another
simple improvement when it fits you.

Cor.

"Bernie Yaeger" <be*****@cherwellinc.com> schreef in bericht
news:eB**************@TK2MSFTNGP11.phx.gbl...
Hi Cor,

There is only the dropdownstyle property, and it is not a boolean; rather
it sets to dropdown, dorpdownlist, etc. Is there a boolean property that
I can't see?

Tx

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
Bernie,

To give me the idea, can you try if this is what you mean, you have to
set the combobox to the normal dropdown however set that
dropdownliststyle to true. I did not test it real deep, hower got the
idea that it was working.

\\\
Private DropDownListStyle As Boolean
Private Sub combobox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
Dim cbo As ComboBox = DirectCast(sender, ComboBox)
Select Case e.KeyCode
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete,
Keys.Down
Return
End Select
Dim ComboBoxText As String = cbo.Text
Dim FirstFound As Integer = cbo.FindString(ComboBoxText)
If FirstFound >= 0 Then
Dim FirstFoundItem As Object = cbo.Items(FirstFound)
Dim FirstFoundText As String =
cbo.GetItemText(FirstFoundItem)
cbo.Text = FirstFoundText
cbo.SelectionStart = ComboBoxText.Length
cbo.SelectionLength = cbo.Text.Length
Else
If DropDownListStyle = True Then
cbo.Text = cbo.Text.Substring(0, cbo.Text.Length - 1)
cbo.SelectionStart = cbo.Text.Length
End If
End If
End Sub
///

I hope we reach the idea?

Cor



Nov 21 '05 #18
Hi,
I was wondering if you ever found a solution to this problem. I am facing something similar right now. I want the drop down to be read only and still have the autocomplete feature.

Appreciate your help.
Sarah

From http://developmentnow.com/g/38_2004_...OPDOWNLIST.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 21 '05 #19
I am using VB 2005. (is there a different group for these questions, since
we haven't reach the release date yet?)

I am playing with the new AutoCompleteMode property of the ComboBox.

When the combobox DropDownStyle is DropDown, autocomplete works as desired.
But it is not "limit-to-list" like old Access. Change the style to
DropDownList and now it is "limit-to-list", but no longer Autocompletes. :(

Anybody have a suggestion?

Greg

"Sarah" <no****@developmentnow.com> wrote in message
news:43**********************************@msnews.m icrosoft.com...
Hi,
I was wondering if you ever found a solution to this problem. I am facing
something similar right now. I want the drop down to be read only and
still have the autocomplete feature.

Appreciate your help.
Sarah

From
http://developmentnow.com/g/38_2004_...OPDOWNLIST.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Nov 21 '05 #20

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.
0
by: peter78 | last post by:
I wanted to implement an autocomplete feature on the combobox where you would type in partial text and it would try to match it for you. It doesn't exist in .Net yet, but I'm guessing it will in...
0
by: Rich | last post by:
Hello, I found this code on google for autocompleting text from a combobox. The works fine. It was the shortest sample of the samples I found. I added a few extra keys to ignore on keyup like...
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...
0
by: Rick | last post by:
Hi, When we create a ComboBox with CustomSource for "AutoCompleteMode.SuggestAppend" it looks working ... but if the first DropDownList is visible and you begin to type text, a second short...
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
6
by: ezyeric13 | last post by:
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...
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...
3
by: Big P | last post by:
I need to make a combobox as dropdownlist that stays white. the combobox becomes gray or silver when i change it as dropdownlist. My question is: How to keep the combobox as dropdownlist in the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
0
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...

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.