|
-
Nov 16th, 1999, 05:53 AM
#9
Junior Member
Try This Procedure. I used it in my project.
It's really work.
Sub Gs_ComboPress(cboCombo As Control, vKeyAscii)
'=================================================
'Function : Use show value of combo (deafault) when press any key.(Ascii)
'Comment : Use procedure at event "keypress"
'=================================================
Dim cboComboTxt As String, xlen%, i%
cboCombo.SelText = ""
cboComboTxt = cboCombo.Text & Chr(vKeyAscii)
xlen = Len(cboComboTxt)
For i = 0 To cboCombo.ListCount - 1
If Len(cboCombo.List(i)) >= xlen Then
If UCase(Left(cboCombo.List(i), xlen)) = UCase(cboComboTxt) Then
cboCombo.Text = cboCombo.List(i)
cboCombo.SelStart = xlen
cboCombo.SelLength = Len(cboCombo.List(i)) - xlen
Exit For
End If
End If
Next
If vKeyAscii >= 45 Then
vKeyAscii = 0
End If
End Sub
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
|