ComboBoxExtendedMatching – Extended Matching mode for ComboBox controls

ComboBoxExtendedMatching – Extended Matching mode for ComboBox controls

' Enable extended matching to any type combobox control'' Extended matching means that as soon as you type in the edit area' of the ComboBox control, the routine searches for a partial match ' in the list area and highlights the characters left to be typed.'' To enable this capability you have only to call this routine' from within the KeyPress routine of the ComboBox, as follows:'' Private Sub Combo1_KeyPress(KeyAscii As Integer)'    ComboBoxExtendedMatching Combo1, KeyAscii' End SubSub ComboBoxExtendedMatching(cbo As ComboBox, KeyAscii As Integer, _    Optional CompareMode As VbCompareMethod = vbTextCompare)    Dim index As Long    Dim Text As String        ' if user pressed a control key, do nothing    If KeyAscii <= 32 Then Exit Sub        ' produce new text, cancel automatic key processing    Text = Left$(cbo.Text, cbo.SelStart) & Chr$(KeyAscii) & Mid$(cbo.Text, _        cbo.SelStart + 1 + cbo.SelLength)    KeyAscii = 0        ' search the current item in the list    For index = 0 To cbo.ListCount - 1        If InStr(1, cbo.List(index), Text, CompareMode) = 1 Then            ' we've found a match            cbo.ListIndex = index            Exit For        End If    Next        ' if no matching item    If index = cbo.ListCount Then        cbo.Text = Text    End If        ' highlight trailing chars in the edit area    cbo.SelStart = Len(Text)    cbo.SelLength = 9999    End Sub

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes