Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

MatchCustom Event, SftMask Object

The user has accepted a custom autocomplete entry.

Syntax

VB.NETPrivate Sub object_MatchCustom(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.MatchCustom
VBPrivate Sub object_MatchCustom(ByVal Text As String, ByVal EntryText As String, ByVal EntryType As Integer)
C#.NETvoid object_MatchCustom(object sender, EventArgumentType e);
VC++void OnMatchCustomobject(_bstr_t Text, _bstr_t EntryText, short EntryType);
CHRESULT OnMatchCustomobject(BSTR Text, BSTR EntryText, short EntryType);

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 text of the custom autocomplete entry selected by the user.

EntryType

An Integer value. This value was used as the EntryType parameter of the AutoComplete.AddTop and AutoComplete.AddBottom methods. Using unique EntryType values for each custom entry, an application can recognize a selected entry without inspecting the text (EntryText).

Comments

The MatchCustom event occurs when the user has accepted a custom autocomplete entry.

Custom entries are always added to the list of autocomplete entries using the AutoComplete.AddTop and AddBottom methods. Custom entries are never saved (see AutoComplete.File property).

If an application adds custom entries, the MatchCustom event must be implemented to perform an action when the user selects a custom entry. There is no default action for custom entries. Custom entries are never used to update the control contents.

If a saved autocomplete entry is accepted by the user, the MatchAccept event occurs instead of the MatchCustom event.

The MatchCustom event only occurs when AutoComplete.Mode is set to autocompleteSftMaskSuggest, the entry list is displayed and the user makes and accepts a selection of a custom entry added using AutoComplete.AddTop or AutoComplete.AddBottom. This event does not occur for other modes.

The Rollup method can be used to close the popup calendar, popup calculator and autocomplete window.

Examples

VB.NET

    AxSftMask1.AutoComplete.AddTop("ZIP-Code Lookup ...", 1)
    AxSftMask1.AutoComplete.AddTop("State Lookup ...", 2)
    If e.count > 6 Then
        AxSftMask1.AutoComplete.AddBottom("ZIP-Code Lookup ...", 2)
        AxSftMask1.AutoComplete.AddBottom("State Lookup ...", 2)
    End If
End Sub

Private Sub AxSftMask1_MatchCustom(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_MatchCustomEvent) Handles AxSftMask1.MatchCustom
    If e.entryType = 1 Then
        AxSftMask1.Rollup()
        MsgBox("We could be looking up ZIP codes in another application...")
        AxSftMask1.Text = "12345"
    End If
    If e.entryType = 2 Then
        AxSftMask1.Rollup()

VB6

    SftMask1.AutoComplete.AddTop "ZIP-Code Lookup ...", 1
    SftMask1.AutoComplete.AddTop "State Lookup ...", 2
    If Count > 6 Then
        SftMask1.AutoComplete.AddBottom "ZIP-Code Lookup ...", 2
        SftMask1.AutoComplete.AddBottom "State Lookup ...", 2
    End If
End Sub

Private Sub SftMask1_MatchCustom(ByVal Text As String, ByVal EntryText As String, ByVal EntryType As Integer)
    If EntryType = 1 Then
        SftMask1.Rollup
        MsgBox ("We could be looking up ZIP codes in another application...")
        SftMask1.Text = "12345"
    End If
    If EntryType = 2 Then
        SftMask1.Rollup

C#

    axSftMask1.AutoComplete.AddTop("ZIP-Code Lookup ...", 1);
    axSftMask1.AutoComplete.AddTop("State Lookup ...", 2);
    if (e.count > 6) {
        axSftMask1.AutoComplete.AddBottom("ZIP-Code Lookup ...", 2);
        axSftMask1.AutoComplete.AddBottom("State Lookup ...", 2);
    }
}

private void axSftMask1_MatchCustom(object sender, AxSftMaskLib70._ISftMaskEvents_MatchCustomEvent e)
{
    if (e.entryType == 1) {
        axSftMask1.Rollup();
        MessageBox.Show("We could be looking up ZIP codes in another application...");
        axSftMask1.Text = "12345";
    }
    if (e.entryType == 2) {

C++

    m_pMask1->AutoComplete->AddTop(_T("ZIP-Code Lookup ..."), 1);
    m_pMask1->AutoComplete->AddTop(_T("State Lookup ..."), 2);
    if (Count > 6) {
        m_pMask1->AutoComplete->AddBottom(_T("ZIP-Code Lookup ..."), 2);
        m_pMask1->AutoComplete->AddBottom(_T("State Lookup ..."), 2);
    }
}

void CProject1Dlg::OnMatchCustomSftMask1(LPCTSTR Text, LPCTSTR EntryText, short EntryType)
{
    if (EntryType == 1) {
        m_pMask1->Rollup();
        AfxMessageBox(_T("We could be looking up ZIP codes in another application..."), MB_OK, 0);
        m_pMask1->Text = _T("12345");
    }
    if (EntryType == 2) {

See Also SftMask Events | Object Hierarchy


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