Results 1 to 5 of 5

Thread: What is AutoComplete feature of a browser? How dose it works?

  1. #1
    Join Date
    Feb 2009
    Posts
    7

    What is AutoComplete feature of a browser? How dose it works?

    What is AutoComplete feature of a browser? How dose it works?

    How can i add the code for this in my vb application Textbox? Is this possible?

  2. #2
    Join Date
    Jun 2008
    Posts
    144

    Re: What is AutoComplete feature of a browser? How dose it works?

    Auto complete is a list of terms that is updated following every new letter or character that you input into the search bar.

    You can use this feature for Vb!

  3. #3
    Join Date
    Jun 2008
    Posts
    97

    Re: What is AutoComplete feature of a browser? How dose it works?

    AutoComplete is a feature of a browser in which the user is provided with the options he has previously used. The AutoComplete feature gives suggestions for possible matches as a user types in. This feature can be enabled or disabled only by the user. It cannot be enabled or disabled by the author of the Web site. The options suggested by the AutoComplete feature can either be used or ignored by the user.

    How to Disable AutoComplete in Firefox ?
    How to clear your AutoComplete History of Internet

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: What is AutoComplete feature of a browser? How dose it works?

    Add File or URL AutoCompletion to TextBoxes and ComboBoxes

    Demonstrates how to add File System and/or URL AutoCompletion to a TextBox or Combo Box, using the same code used for the System Common Dialog file name, Start->Run dialog box and IE Address bar. Note that IE5 or above is required to use this function.

    Start a new project in VB and add a Module. Then add this code to the Module:

    Code:
    Option Explicit
    
    Public Enum SHAutoCompleteFlags
       ' // Currently (SHACF_FILESYSTEM | SHACF_URLALL)
       SHACF_DEFAULT = &H0
       ' // This includes the File System as well as the rest of the shell 
       ' (Desktop\My Computer\Control Panel\)
       SHACF_FILESYSTEM = &H1
       ' // URLs in the User's History
       SHACF_URLHISTORY = &H2
       ' // URLs in the User's Recently Used list.
       SHACF_URLMRU = &H4
       ' // Use the tab to move thru the autocomplete possibilities 
       ' instead of to the next dialog/window control.
       SHACF_USETAB = &H8
       SHACF_URLALL = (SHACF_URLHISTORY Or SHACF_URLMRU)
       ' // This includes the File System 
       SHACF_FILESYS_ONLY = &H10                     
    
    '#if (_WIN32_IE >= = &H0600)
       ' // Same as SHACF_FILESYS_ONLY except it only includes directories, 
       ' UNC servers, and UNC server shares. 
       SHACF_FILESYS_DIRS = &H20                     
    '#End If ' // (_WIN32_IE >= = &H0600)
       
       ' // Ignore the registry default and force the feature on.
       SHACF_AUTOSUGGEST_FORCE_ON = &H10000000
       ' // Ignore the registry default and force the feature off.
       SHACF_AUTOSUGGEST_FORCE_OFF = &H20000000
       ' // Ignore the registry default and force the feature on. 
       ' (Also know as AutoComplete)
       SHACF_AUTOAPPEND_FORCE_ON = &H40000000
        ' // Ignore the registry default and force the feature off. 
        ' (Also know as AutoComplete)
       SHACF_AUTOAPPEND_FORCE_OFF = &H80000000
    End Enum
    
    Private Declare Function SHAutoComplete Lib "shlwapi.dll" ( _
       ByVal hwndEdit As Long, ByVal dwFlags As Long) As Long
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
       (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As String, _
       ByVal lpszWindow As String) As Long
    
    Private Const S_OK = 0
    
    Public Function AutoComplete( _
          ByVal hWnd As Long, _
          ByVal eFlags As SHAutoCompleteFlags _
       )
    Dim lR As Long
       lR = SHAutoComplete(hWnd, eFlags)
       AutoComplete = (lR <> S_OK)
    End Function
    Public Function GetComboBoxEdithWnd(ByVal hWnd As Long) As Long
       GetComboBoxEdithWnd = FindWindowEx(hWnd, 0, "EDIT", vbNullString)
    End Function
    To test the function, add a TextBox and a ComboBox to the Project's form. Name the TextBox "txtTest" and the ComboBox "cboTest". Then add this code to the project's form:

    Code:
    Private Sub Form_Load()
       AutoComplete txtTest.hWnd, SHACF_FILESYS_ONLY
       AutoComplete GetComboBoxEdithWnd(cboTest.hWnd), SHACF_FILESYS_ONLY
    End Sub
    Run the project. When you start typing a file name into either of the controls, you will see that the AutoComplete drop down displays, and you can pick the nearest matching file.

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: What is AutoComplete feature of a browser? How dose it works?

    The important event that will fire whenever the user press any key is onkeydown. The onkeydown event handles all the normal character input and is in charge of creating the auto-complete list. It also handles keys like 'up', 'down' and 'enter'.

    Using the JavaScript regexp() object, the script will run through the array containing the keywords and match them one by one. After which, a DIV will be created dynamically using document.createElement(). Finally, when the user presses the 'Enter' key, the DIV will be detached and the input box updated.

    The user can also select the options using the mouse. This is done through three events: onmouseover, onmouseout, and onclick.

    Please refer this for understanding the code!
    http://www.codeproject.com/KB/scripting/jsactb.aspx

    Hope this helps!

Similar Threads

  1. Immunize feature of spybot is not working for all browser
    By Falgu in forum Networking & Security
    Replies: 5
    Last Post: 18-07-2012, 12:17 PM
  2. How the new collection feature works in Garden of Time
    By Raju Chacha in forum Video Games
    Replies: 6
    Last Post: 25-12-2011, 11:36 AM
  3. How the feature of pc analyzer/ pc TuneUp in works AVG Free 2011?
    By Mallory c in forum Networking & Security
    Replies: 6
    Last Post: 08-08-2011, 10:50 PM
  4. Virus problem in browser Autocomplete
    By Walter89 in forum Networking & Security
    Replies: 3
    Last Post: 27-10-2009, 05:51 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,540,147.31723 seconds with 16 queries