Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Implementing some browser's features

Posted on 1999-10-01
Medium Priority
Last Modified: 2010-05-02
 How can I implement a autocomplete feature like in Internet Explorer?
  and a "What's related?" feature like netscape?
Question by:felipes
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 14

Accepted Solution

waty earned 400 total points
ID: 2090923
' #VBIDEUtils#************************************************************
' * Programmer Name  : Waty Thierry
' * Web Site         :
' * E-Mail           :
' * Date             : 28/06/99
' * Time             : 12:24
' **********************************************************************
' * Comments         : Auto-Complete function
' *
' *
' **********************************************************************

Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_FINDSTRING = &H14C
Private Const CB_ERR = (-1)

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const CB_SETCURSEL = &H14E
Private m_bEditFromCode As Boolean

Private Sub Form_Load()
   With Combo1
      .AddItem "VB Square"
      .AddItem ""
      .AddItem "VB World"
      .AddItem ""
   End With
End Sub

Private Sub Combo1_Change()
   Dim i As Long, j As Long
   Dim strPartial As String, strTotal As String
   If m_bEditFromCode Then
      m_bEditFromCode = False
      Exit Sub
   End If
   With Combo1
      strPartial = .Text
      i = SendMessage(.hwnd, CB_FINDSTRING, -1, ByVal strPartial)
      If i <> CB_ERR Then
         strTotal = .List(i)
         j = Len(strTotal) - Len(strPartial)
         If j <> 0 Then
            m_bEditFromCode = True
            .SelText = Right$(strTotal, j)
            'Select unmatched characters
            .SelStart = Len(strPartial)
            .SelLength = j
         End If
      End If
   End With
End Sub

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
   Select Case KeyCode
      Case vbKeyDelete
         m_bEditFromCode = True
      Case vbKeyBack
         m_bEditFromCode = True
   End Select
End Sub


Author Comment

ID: 2140467
 Ok, you haven't implemented the What's related but I'll give you the points. :-D

Expert Comment

ID: 6859402
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.
Thank you,
Moderator @ Experts Exchange

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question