Quantcast
Viewing all articles
Browse latest Browse all 15612

Listview Autocomplete

Good morning, how can I autocomplete column 2 Name which is text,
this code is only valid for autocomplete the index

Posted by Andrew G

Code:

Dim DelKey As Boolean
Private Sub Text1_Change()
On Error GoTo ErrMsg
 
Dim LstItm As ListItem
    ListView1.FindItem(Text1.Text, , , 1).Selected = True
     
    If Not DelKey Then
        'If something was chosen then we get the rest of it
        strt = Len(Text1.Text)
        Text1.Text = ListView1.SelectedItem.Text
        Text1.SelStart = strt
        Text1.SelLength = Len(Text1.Text) - strt
    End If
   
    DelKey = False
 
Exit Sub
ErrMsg:
    ListView1.SelectedItem.Selected = False
End Sub
 
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDelete Or KeyCode = 8 Then DelKey = True
End Sub

Image may be NSFW.
Clik here to view.
Name:  6d594f91d627d806e1b0cd9052f2cc6a.jpg
Views: 48
Size:  57.4 KB


TnX
Attached Images
Image may be NSFW.
Clik here to view.
 

Viewing all articles
Browse latest Browse all 15612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>