Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Contents Property, SftMask Object

Returns the SftMaskContents object.

Syntax

Get

VB.NETrefContentsObj = object.Contents As SftMaskContents
VBSet refContentsObj = object.Contents As SftMaskContents
C#.NETSftMaskContents refContentsObj = object.Contents;
VC++ISftMaskContents* refContentsObj = object->Contents;
ISftMaskContents* refContentsObj = object->GetContents();
CHRESULT object->get_Contents(ISftMaskContents** refContentsObj);

object

A SftMask object.

refContentsObj

Returns the SftMaskContents object.

Comments

The Contents property returns the SftMaskContents object.

The contents of the control can be accessed or updated using the returned SftMaskContents object.

Examples

VB.NET

    AxSftMask1.Mask = "(!0###!!) !1###!!\-!2####!!"
    AxSftMask1.Caption.Text = "&Phone Number: "
    AxSftMask1.Caption.SizePercent = 40
    AxSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskRight
    AxSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskLeft
    AxSftMask1.Caption.VerticalAlignment = SftMaskVerticalAlignConstants.valignSftMaskBaseline
    AxSftMask1.AutoSize = True
    AxSftMask1.Text = "9415058600"
    MsgBox("The area code is " & AxSftMask1.Contents.Value(0))
    MsgBox("The exchange is " & AxSftMask1.Contents.Value(1))
    MsgBox("The last 4 digits are " & AxSftMask1.Contents.Value(2))
    AxSftMask1.Contents.Value(2) = "8555"
End Sub

VB6

    SftMask1.Mask = "(!0###!!) !1###!!\-!2####!!"
    SftMask1.Caption.Text = "&Phone Number: "
    SftMask1.Caption.SizePercent = 40
    SftMask1.Caption.Alignment = alignSftMaskRight
    SftMask1.Caption.Position = positionSftMaskLeft
    SftMask1.Caption.VerticalAlignment = valignSftMaskBaseline
    SftMask1.AutoSize = True
    SftMask1.Text = "9415058600"
    MsgBox ("The area code is " & SftMask1.Contents.Value(0))
    MsgBox ("The exchange is " & SftMask1.Contents.Value(1))
    MsgBox ("The last 4 digits are " & SftMask1.Contents.Value(2))
    SftMask1.Contents.Value(2) = "8555"
End Sub

C#

    axSftMask1.Mask = @"(!0###!!) !1###!!\-!2####!!";
    axSftMask1.Caption.Text = "&Phone Number: ";
    axSftMask1.Caption.SizePercent = 40;
    axSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskRight;
    axSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskLeft;
    axSftMask1.Caption.VerticalAlignment = SftMaskVerticalAlignConstants.valignSftMaskBaseline;
    axSftMask1.AutoSize = true;
    axSftMask1.Text = "9415058600";
    MessageBox.Show("The area code is " + axSftMask1.Contents.get_Value(0).ToString());
    MessageBox.Show("The exchange is " + axSftMask1.Contents.get_Value(1).ToString());
    MessageBox.Show("The last 4 digits are " + axSftMask1.Contents.get_Value(2).ToString());
    axSftMask1.Contents.set_Value(2, "8555");
}

C++

    m_pMask1->Caption->Text = _T("&Phone Number: ");
    m_pMask1->Caption->SizePercent = 40;
    m_pMask1->Caption->Alignment = alignSftMaskRight;
    m_pMask1->Caption->Position = positionSftMaskLeft;
    m_pMask1->Caption->VerticalAlignment = valignSftMaskBaseline;
    m_pMask1->AutoSize = VARIANT_TRUE;
    m_pMask1->Text = _T("9415058600");
    CString str;
    variant_t v = m_pMask1->Contents->Value[0];
    v.ChangeType(VT_BSTR);
    str.Format(_T("The area code is %s"), CString(v.bstrVal));
    AfxMessageBox(str);
    v = m_pMask1->Contents->Value[1];
    v.ChangeType(VT_BSTR);
    str.Format(_T("The exchange is %s"), CString(v.bstrVal));
    AfxMessageBox(str);

See Also SftMask Object | Object Hierarchy


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