Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This code uses a simple text box and drop down lis...
Author:
Thomas Kelly
E-mail:
Click to e-mail author
Submitted:
9/28/2001
Version:
VB6
Compatibility:
VB6
Category:
Views:
13730
This code uses a simple text box and drop down list. When the user types into the text box it will search the drop down list and retun the item that matches. You will need a text box with ID of 't1' and a combo box with an ID of 'sel1'
Declarations:
'none
Code:
function t1_onkeyup() dim s, i, l, ifound s = t1.value l = len(s) ifound=false i=0 sel1.selectedIndex = i ifound = false if s <> "" then do while sel1.selectedIndex <> sel1.length - 1 if Ucase(mid(sel1.options(sel1.selectedIndex).innertext,1,l)) = Ucase(s) then ifound = true exit do else sel1.selectedIndex = sel1.selectedIndex + 1 end if loop if ifound = false then sel1.selectedindex = -1 end if end if end function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement