if you want to implement the AutoComplete that InternetExplorer uses ( eg: retrieve the web pages visited etc... ) you need to find the EDIT window of your ComboBox , then you can set the SHAutoComplete on it , eg:
hope it helpsVB Code:
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As IntPtr, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As IntPtr Private Declare Sub SHAutoComplete Lib "shlwapi.dll" (ByVal hwndEdit As IntPtr, ByVal dwFlags As Int32) Private Const SHACF_AUTOAPPEND_FORCE_ON As Int32 = &H40000000 Private Const SHACF_AUTOSUGGEST_FORCE_ON As Int32 = &H10000000 Private Const SHACF_URLHISTORY As Int32 = &H2 Private Const SHACF_URLMRU As Int32 = &H4 Private Const SHACF_URLALL As Int32 = (SHACF_URLHISTORY Or SHACF_URLMRU) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '/// first you need to find the EDIT part of the ComboBox Dim ptr As IntPtr = FindWindowEx(ComboBox1.Handle, 0, "EDIT", Nothing) If Not ptr.Equals(IntPtr.Zero) Then '/// it's found it. SHAutoComplete(ptr, SHACF_AUTOAPPEND_FORCE_ON Or SHACF_AUTOSUGGEST_FORCE_ON Or SHACF_URLALL) End If End Sub![]()





Reply With Quote