Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Typing into a combo box


Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2001, 12:44 PM
Rich
Guest
 
Posts: n/a
Default Typing into a combo box


Hey all,

I'd like to type into a combo box and have the contents of the Combo box appear in the text area as I type letters. Kind of like the way that the index of MSDN finds the items in the listbox by the letters typed into the textbox above...

Any ideas?

Thanks in advance,

Rich
Reply With Quote
  #2  
Old 10-31-2001, 12:50 PM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,883
Default Re: Typing into a combo box

Perform a "search" on the forum first, there is already a fresh thread discussing this.
Reply With Quote
  #3  
Old 10-31-2001, 01:02 PM
Rich
Guest
 
Posts: n/a
Default Re: Typing into a combo box

Do you happen to have a keyword for the search, because I've been searching before and since my question was posted...

Thanks

Rich
Reply With Quote
  #4  
Old 10-31-2001, 01:08 PM
Laurent Laurent is offline
Senior Contributor

Retired Leader
* Expert *
 
Join Date: Apr 2001
Location: canada, quebec
Posts: 1,334
Default Re: Typing into a combo box

isn't this used by default in the combobox? as soon as you type something, it shows the first corresponding item in the list...

on the other hand it doesn't select the given item when it loses focus, to do so you can try something like this
Private Sub cmbListeClient_LostFocus()
If Trim(cmbListeClient.Text) <> "" Then
Dim i As Integer
For i = 0 To cmbListeClient.ListCount
If UCase(Left(cmbListeClient.List(i), Len(cmbListeClient.Text))) = UCase(cmbListeClient.Text) Then
cmbListeClient.ListIndex = i
Exit For
End If
Next i
End If
End Sub

this example is the one i use for the combobox where i have a list of client
__________________
Still tons to learn!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->