Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Matching Event, SftMask Object

Accept an autocomplete text entry for display.

Syntax

VB.NETPrivate Sub object_Matching(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.Matching
VBPrivate Sub object_Matching(ByVal Text As String, EntryText As String, Accept As Boolean)
C#.NETvoid object_Matching(object sender, EventArgumentType e);
VC++void OnMatchingobject(_bstr_t Text, _bstr_t* EntryText, VARIANT_BOOL* Accept);
CHRESULT OnMatchingobject(BSTR Text, BSTR* EntryText, VARIANT_BOOL* Accept);

object

A SftMask object.

Text

A string containing the current control contents. Equivalent to the Text property (including all literals, regardless of the current ClipMode settings).

EntryText

A string containing the saved autocomplete entry about to be added to the list. The EntryText parameter can be modified to change the text. If this is an empty string, this is the initial call.

Accept

A Boolean value. If True is returned, the saved autocomplete text entry is added to the list. If False is returned, the saved autocomplete entry is not added to the list.

Comments

The Matching event occurs to determine whether to accept an autocomplete text entry for display.

The Matching event can be used to reject or modify an autocomplete entry that is about to be added to the list for display.

This event occurs for each saved autocomplete entry. The control evaluates the Accept parameter before invoking this event, using its built-in matching mechanism. The Matching event does not need to be implemented to use the built-in matching mechanism of the control.

While handling this event, the Masked Edit control must not be updated through its methods or properties.

Custom entries can be added using the AutoComplete.AddTop and AutoComplete.AddBottom methods.

Examples

VB.NET

    End If
    If e.entryType = 2 Then
        AxSftMask1.Rollup()
        MsgBox("We could be looking up states in another application...")
        AxSftMask1.AutoComplete.Refresh()
    End If
End Sub

Private Sub AxSftMask1_Matching(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_MatchingEvent) Handles AxSftMask1.Matching
    If Mid(e.entryText, 1, 1) = "0" Then
        ' don't show any ZIP code starting with a "0"
        e.accept = False
    End If
End Sub

VB6

    End If
    If EntryType = 2 Then
        SftMask1.Rollup
        MsgBox ("We could be looking up states in another application...")
        SftMask1.AutoComplete.Refresh
    End If
End Sub

Private Sub SftMask1_Matching(ByVal Text As String, EntryText As String, Accept As Boolean)
    If Mid(EntryText, 1, 1) = "0" Then
        ' don't show any ZIP code starting with a "0"
        Accept = False
    End If
End Sub

C#

    }
    if (e.entryType == 2) {
        axSftMask1.Rollup();
        MessageBox.Show("We could be looking up states in another application...");
        axSftMask1.AutoComplete.Refresh();
    }
}

private void axSftMask1_Matching(object sender, AxSftMaskLib70._ISftMaskEvents_MatchingEvent e)
{
    if (e.entryText[0] == '0') {
        // don't show any ZIP code starting with a "0"
        e.accept = false;
    }
}

C++

    }
    if (EntryType == 2) {
        m_pMask1->Rollup();
        AfxMessageBox(_T("We could be looking up states in another application..."), MB_OK, 0);
        m_pMask1->AutoComplete->Refresh();
    }
}

void CProject1Dlg::OnMatchingSftMask1(LPCTSTR Text, BSTR FAR* EntryText, BOOL FAR* Accept)
{
    if (*EntryText[0] == L'0') {
        //' don't show any ZIP code starting with a "0"
        *Accept = VARIANT_FALSE;
    }
}

See Also SftMask Events | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.