HeaderPane
Main
Hide
Share Link
Print

Change Event, SftMask Object

The control contents are changing.

Syntax

C#void object_Change(object sender, EventArgumentType e);
VB.NETPrivate Sub object_Change(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.Change
C++void OnChangeobject();
CHRESULT OnChangeobject();

object

A SftMask object.

Comments

The Change event occurs when the control contents are changing.

This event occurs whenever the control's contents (Text property) are changing. Only changes caused by the user will generate this event. Changes caused by the application, through properties and methods, will not generate this event.

In addition to the Change event, the UpDownHandled event occurs when the control contents have been modified using the up/down button.

Examples

C# View entire sample code

    axSftMask1.Caption.Text = "&Text:";
    axSftMask1.Mask = @"\(###\) ###\-####";
    axSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskLeft;
    axSftMask1.BackColorInvalid = Color.Red;
    axSftMask1.ForeColorInvalid = Color.White;
    axSftMask1.FormattedText = "Please enter a telephone number";
}

private void axSftMask1_Change(object sender, System.EventArgs e)
{
    if (axSftMask1.Contents.Valid) {
        MessageBox.Show("This is a valid phone number.");
    } else {
        if (axSftMask1.Contents.Empty)
            axSftMask1.FormattedText = "Please enter a telephone number";
        else

VB.NET View entire sample code

    AxSftMask1.Caption.Text = "&Text:"
    AxSftMask1.Mask = "\(###\) ###\-####"
    AxSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskLeft
    AxSftMask1.BackColorInvalid = Color.Red
    AxSftMask1.ForeColorInvalid = Color.White
    AxSftMask1.FormattedText = "Please enter a telephone number"
End Sub

Private Sub AxSftMask1_Change(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftMask1.Change
    If AxSftMask1.Contents.Valid Then
        MsgBox("This is a valid phone number.")
    Else
        If AxSftMask1.Contents.Empty Then
            AxSftMask1.FormattedText = "Please enter a telephone number"
        Else
            AxSftMask1.FormattedText = ""

C++ View entire sample code

    m_pMask1->Alignment = alignSftMaskLeft;
    m_pMask1->BackColorInvalid = RGB(255,0,0);
    m_pMask1->ForeColorInvalid = RGB(255,255,255);
    m_pMask1->FormattedText = _T("Please enter a telephone number");

    return TRUE;
}

void CProject1Dlg::OnChangeSftMask1()
{
    if (m_pMask1->Contents->Valid != VARIANT_FALSE) {
        AfxMessageBox(_T("This is a valid phone number."));
    } else {
        if (m_pMask1->Contents->Empty != VARIANT_FALSE)
            m_pMask1->FormattedText = _T("Please enter a telephone number");
        else

See Also SftMask Events | Object Hierarchy


Last Updated 11/15/2026 - (email)
© 2026 Softel vdm, Inc.