Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

AllowEmpty Property, SftMask Object

Defines whether the contents are optional when a mask is defined (control contents are valid even if empty).

Syntax

Get

VB.NETBoolean = object.AllowEmpty As Boolean
VBBoolean = object.AllowEmpty As Boolean
C#.NETbool Boolean = object.AllowEmpty;
VC++VARIANT_BOOL Boolean = object->AllowEmpty;
VARIANT_BOOL Boolean = object->GetAllowEmpty();
CHRESULT object->get_AllowEmpty(VARIANT_BOOL* Boolean);

Put

VB.NETobject.AllowEmpty = Boolean As Boolean
VBobject.AllowEmpty = Boolean As Boolean
C#.NETbool object.AllowEmpty = Boolean;
VC++VARIANT_BOOL object->AllowEmpty = Boolean;
void object->PutAllowEmpty(VARIANT_BOOL Boolean);
CHRESULT object->put_AllowEmpty(VARIANT_BOOL Boolean);

object

A SftMask object.

Boolean

Defines whether the contents are optional when a mask is defined (control contents are valid even if empty).

BooleanDescription
TrueThe control contents are optional.
FalseThe control contents are not optional and must be entered.

Comments

Defines whether the contents are optional when no mask is defined (control contents are valid even if empty).

This property is only used when the Mask property defines an input mask. Otherwise, the AllowEmptyWithoutMask property is used instead. It is usually best to set the AllowEmpty and AllowEmptyWithoutMask properties to the same value.

If AllowEmpty is set to False, the contents are considered invalid if the control is empty and the user has not entered any data.

The Contents.Valid and Contents.ValidMsg properties can be used to test the contents.

The ValidationError event occurs when invalid input is detected.

Examples

VB.NET

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AxSftMask1.Mask = "$D"
    AxSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskLeft
    AxSftMask1.EditStyle = SftMaskEditStyleConstants.editSftMaskCalendarDropDown
    AxSftMask1.AutoAdvance = True
    AxSftMask1.TabAdvance = True
    AxSftMask1.AllowEmpty = False
    AxSftMask1.MessageTitle = "Sample"
    AxSftMask1.MessageEmpty = "Please enter a date"
    AxSftMask1.MessageInvalid = "Please enter a valid date"
    AxSftMask1.AutoSize = True
    AxSftMask1.Calendar.CircleToday = True
    AxSftMask1.Calendar.WeekNumbers = True
    AxSftMask1.Calendar.FirstDate = #1/1/2000#
    AxSftMask1.Calendar.LastDate = #12/31/2020#
    AxSftMask1.Calendar.ShowToday = True

VB6

Private Sub Form_Load()
    SftMask1.Mask = "$D"
    SftMask1.Alignment = alignSftMaskLeft ' edit control
    SftMask1.EditStyle = editSftMaskCalendarDropDown
    SftMask1.AutoAdvance = True
    SftMask1.TabAdvance = True
    SftMask1.AllowEmpty = False
    SftMask1.MessageTitle = "Sample"
    SftMask1.MessageEmpty = "Please enter a date"
    SftMask1.MessageInvalid = "Please enter a valid date"
    SftMask1.AutoSize = True
    SftMask1.Calendar.CircleToday = True
    SftMask1.Calendar.WeekNumbers = True
    SftMask1.Calendar.FirstDate = #1/1/2000#
    SftMask1.Calendar.LastDate = #12/31/2020#
    SftMask1.Calendar.ShowToday = True

C#

private void Form1_Load(object sender, System.EventArgs e)
{
    axSftMask1.Mask = "$D";
    axSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskLeft;
    axSftMask1.EditStyle = SftMaskEditStyleConstants.editSftMaskCalendarDropDown;
    axSftMask1.AutoAdvance = true;
    axSftMask1.TabAdvance = true;
    axSftMask1.AllowEmpty = false;
    axSftMask1.MessageTitle = "Sample";
    axSftMask1.MessageEmpty = "Please enter a date";
    axSftMask1.MessageInvalid = "Please enter a valid date";
    axSftMask1.AutoSize = true;
    axSftMask1.Calendar.CircleToday = true;
    axSftMask1.Calendar.WeekNumbers = true;
    axSftMask1.Calendar.FirstDate = new DateTime(2000, 1, 1);
    axSftMask1.Calendar.LastDate = new DateTime(2020, 12, 31);

C++

    m_pMask1 = m_Mask1.GetControlUnknown();
    _ASSERT(m_pMask1 != NULL);

    m_pMask1->Mask = _T("$D");
    m_pMask1->Alignment = alignSftMaskLeft;
    m_pMask1->EditStyle = editSftMaskCalendarDropDown;
    m_pMask1->AutoAdvance = VARIANT_TRUE;
    m_pMask1->TabAdvance = VARIANT_TRUE;
    m_pMask1->AllowEmpty = VARIANT_FALSE;
    m_pMask1->MessageTitle = _T("Sample");
    m_pMask1->MessageEmpty = _T("Please enter a date");
    m_pMask1->MessageInvalid = _T("Please enter a valid date");
    m_pMask1->AutoSize = VARIANT_TRUE;
    m_pMask1->Calendar->CircleToday = VARIANT_TRUE;
    m_pMask1->Calendar->WeekNumbers = VARIANT_TRUE;

See Also SftMask Object | Object Hierarchy


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