VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Function to automatically Scroll a simple combo box when characters are typed in. When calling this

by Issa Fahmy (7 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Wed 15th August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Function to automatically Scroll a simple combo box when characters are typed in. When calling this function you need to declare privately the

API Declarations


Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long


Rate Function to automatically Scroll a simple combo box when characters are typed in. When calling this



  Dim iStart As Integer
  Dim str As String
  
  iStart = 1
  iStart = cbo.SelStart
  If iLeftOff <> 0 Then
    cbo.SelStart = iLeftOff
    iStart = iLeftOff
  End If
  
  str = CStr(Left(cbo.Text, iStart))
  cbo.ListIndex = SendMessage(cbo.hwnd, CBFINDSTRING, -1, ByVal str)
  If cbo.ListIndex = -1 Then
    iLeftOff = Len(str)
    cbo.Text = str
  End If
  cbo.SelStart = iStart
  cbo.SelLength = Len(str) - iStart
  iLeftOff = 0

End Function

Download this snippet    Add to My Saved Code

Function to automatically Scroll a simple combo box when characters are typed in. When calling this Comments

No comments have been posted about Function to automatically Scroll a simple combo box when characters are typed in. When calling this. Why not be the first to post a comment about Function to automatically Scroll a simple combo box when characters are typed in. When calling this.

Post your comment

Subject:
Message:
0/1000 characters