|
-
Mar 15th, 2003, 05:46 AM
#1
Thread Starter
Member
List box problem
Can any body help me?
As I begin to write in a text box - the list box will show rearranging it items bring the items first those items matching the characters I am typing in the text box.
It should work as like MSDN index option.
Please help it urgent
-
Mar 15th, 2003, 09:58 AM
#2
Hyperactive Member
hmm... i'd reccomend on the keypress event, having it loop through all the elements in the listbox and see if what you've entered matches. if it does, move it to the top. something like
VB Code:
Sub Text1_KeyPress(KeyAscii as Integer)
For c = 0 to List1.ListCount 'i forget if this is the right property, but you know what i mean
If Text1.Text = Mid(List1.List(c),1,len(Text1.text)) Then
str1=List1.List(0)
str2=List1.List(c)
List1.List(0)=str2
List1.List(c)=str1
End If
Next c
End Sub
If I agree with you today, don't get used to it.
-
Mar 15th, 2003, 11:15 AM
#3
Lively Member
'use sendmessage API
Private Sub Text1_Change()
List1.ListIndex = SendMessage(List1.hWnd, _
LB_FINDSTRING, -1, ByVal Text1.Text)
End Sub
An ass may bray a good long time before he shakes the stars down.
T.S. Elliot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|