HeaderPane
Main
Hide
Share Link
Print

Empty Property, SftMaskContents Object

Determines whether data has been entered.

Syntax

Get

C#bool Boolean = object.Empty;
VB.NETBoolean = object.Empty As Boolean
C++VARIANT_BOOL Boolean = object->Empty;
VARIANT_BOOL Boolean = object->GetEmpty();
CHRESULT object->get_Empty(VARIANT_BOOL* Boolean);

object

A SftMaskContents object.

Boolean

Determines whether data has been entered.

BooleanDescription
TrueThe contents of the control are empty. The user has not entered any data.
FalseThe contents of the control are not empty.

Comments

The Empty property determines whether data has been entered.

The AllowEmpty property can be used to enable optional data input.

If the DefaultText property is used, the control contents are automatically updated with the string defined by the DefaultText property. In that case, the control is no longer considered empty and the Empty property will return False.

Examples

C# View entire sample code

    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
            axSftMask1.FormattedText = "";
    }
}

VB.NET View entire sample code

    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 = ""
        End If
    End If
End Sub

C++ View entire sample code

    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
            m_pMask1->FormattedText = _T("");
    }
}

BEGIN_EVENTSINK_MAP(CProject1Dlg, CDialog)

See Also SftMaskContents Object | Object Hierarchy


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