Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

ValidMsg Property, SftMaskContents Object

Determines whether the contents are valid (with error message handling).

Syntax

Get

VB.NETBoolean = object.ValidMsg As Boolean
VBBoolean = object.ValidMsg As Boolean
C#.NETbool Boolean = object.ValidMsg;
VC++VARIANT_BOOL Boolean = object->ValidMsg;
VARIANT_BOOL Boolean = object->GetValidMsg();
CHRESULT object->get_ValidMsg(VARIANT_BOOL* Boolean);

object

A SftMaskContents object.

Boolean

Determines whether the contents are valid (with error message handling).

BooleanDescription
TrueThe control's contents are valid.
FalseThe control's contents are not valid. An error message based on MessageEmpty or MessageInvalid has been displayed.

Comments

The ValidMsg property determines whether the contents are valid (with error message handling).

The error message defined by the MessageEmpty or MessageInvalid properties is displayed if the contents are empty or invalid.

The AllowEmpty property defines whether the contents are optional (valid even if empty).

If the control contents don't match the defined mask (see Mask property), the ValidationError event occurs.

If the control contents are valid and match the defined mask (see Mask property), the CustomValidation event is invoked.

The Contents.ValidMsg property can also be used to determine whether the contents are valid without the display of an error message.

Examples

VB.NET

    AxSftMask1.Calendar.BoldDate = #1/9/2007#
    AxSftMask1.Calendar.BoldDate = #1/16/2007#
    AxSftMask1.Calendar.BoldDate = #1/23/2007#
    AxSftMask1.Calendar.BoldDate = #1/30/2007#
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim test As Boolean
    test = AxSftMask1.Contents.ValidMsg
End Sub

VB6

    SftMask1.Calendar.BoldDate = #1/16/2007#
    SftMask1.Calendar.BoldDate = #1/23/2007#
    SftMask1.Calendar.BoldDate = #1/30/2007#
End Sub

' Button Click Event
Private Sub Command1_Click()
    Dim test As Boolean
    test = SftMask1.Contents.ValidMsg
End Sub

C#

    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 16);
    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 23);
    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 30);
}

private void button1_Click(object sender, System.EventArgs e)
{
    bool test;
    test = axSftMask1.Contents.ValidMsg;
}

C++

    m_pMask1->Calendar->BoldDate = COleDateTime(2007, 1, 16, 0,0,0);
    m_pMask1->Calendar->BoldDate = COleDateTime(2007, 1, 23, 0,0,0);
    m_pMask1->Calendar->BoldDate = COleDateTime(2007, 1, 30, 0,0,0);
}

void CProject1Dlg::OnButton1()
{
    VARIANT_BOOL Test;
    Test = m_pMask1->Contents->ValidMsg;
}

BEGIN_EVENTSINK_MAP(CProject1Dlg, CDialog)
    //{{AFX_EVENTSINK_MAP(CProject1Dlg)
    ON_EVENT(CProject1Dlg, IDC_SFTMASK1, 28 /* UpdateMonth */, OnUpdateMonthSftMask1, VTS_DATE)
    //}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

See Also SftMaskContents Object | Object Hierarchy


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