Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Text Property, SftMask Object

Defines the control contents.

Syntax

Get

VB.NETString = object.Text As String
VBString = object.Text As String
C#.NETstring String = object.Text;
VC++_bstr_t String = object->Text;
_bstr_t String = object->GetText();
CHRESULT object->get_Text(BSTR* String);

Put

VB.NETobject.Text = String As String
VBobject.Text = String As String
C#.NETstring object.Text = String;
VC++_bstr_t object->Text = String;
void object->PutText(_bstr_t String);
CHRESULT object->put_Text(BSTR String);

object

A SftMask object.

String

Defines the control contents. A simple string or special symbolic values can be used. Symbols start with the = sign.

Comments

The Text property defines the control contents.

The DefaultText property can be used to define a default value for the Text property, when the Text property becomes empty.

When retrieving or setting the Text property in a Masked Edit control (with Mask), input positions without data are represented by the carriage return (Chr(13)) character. This allows the distinction between unspecified data and specified (but blank) data fields. A simple edit control (without Mask) does not have unspecified positions and never uses the carriage return place holder. The otherwise equivalent TextDisplay property returns space characters instead.

The ClipMode property affects the handling of literal characters.

It is possible to retrieve portions of the control contents using the Contents.Value property.

When assigning a string to the Text property, the following special symbolic values are allowed, which are replaced by their actual values:

SymbolValue UsedAssigned To
=TodayToday's date and the current timeContents.DateTime
=NowToday's date and the current timeContents.DateTime
=YesterdayYesterday's date and the current timeContents.DateTime
=TomorrowTomorrow's date and the current timeContents.DateTime

Symbols are case sensitive and the leading = sign is required. When using symbolic values, no other characters can appear in the specified String argument.

The properties TextDisplay, TextDisplayWithLiterals, TextDisplayNoLiterals, TextPureWithLiterals and TextPureNoLiterals also retrieve the control contents with varying handling of unspecified input positions and literal characters.

PropertyUnspecified PositionsLiterals
TextChr(13)ClipMode
TextDisplaySpaceClipMode
TextDisplayNoLiteralsSpaceNo
TextDisplayWithLiteralsSpaceYes
TextPureNoLiteralsChr(13)No
TextPureWithLiteralsChr(13)Yes

Examples

VB.NET

Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
    End
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    SftMaskPhone.Text = "9415058600" ' our phone number
    SftMaskPhone.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectHome ' set the input location
    SftMaskSSN.Text = "444-12-1111" ' a social security number
    SftMaskToday.Contents.DateTime = Today ' set today's date
    SftMaskTime.Contents.DateTime = TimeOfDay
    SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent
    SftMaskAmount.Text = CStr(199)
    SftMaskIPAddr.Text = "209.61.201.49"
End Sub

Private Sub SftMaskAmount_UpDownPress(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_UpDownPressEvent) Handles SftMaskAmount.UpDownPress

VB6

Option Explicit

Private Sub Command1_Click()
    End
End Sub

Private Sub Form_Load()
    SftMaskPhone.Text = "9415058600" ' our phone number
    SftMaskPhone.SelStart = 1  ' set the input location
    SftMaskSSN.Text = "444-12-1111" ' a social security number
    SftMaskToday.Contents.DateTime = Date ' set today's date
    SftMaskTime.Contents.DateTime = Time
    SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent
    SftMaskAmount.Text = 199
    SftMaskIPAddr.Text = "209.61.201.49"
End Sub

C#

private void Form1_Load(object sender, System.EventArgs e)
{
    SftMaskPhone.Text = "9415058600"; // our phone number
    SftMaskPhone.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectHome; // set the input location
    SftMaskSSN.Text = "444-12-1111"; // a social security number
    SftMaskToday.Contents.DateTime = System.DateTime.Now; // set today's date
    SftMaskTime.Contents.DateTime = System.DateTime.Now;
    SftMaskPercent.Contents.set_Value(0, 50); // start with 50 percent
    SftMaskAmount.Text = "199";
    SftMaskIPAddr.Text = "209.61.201.49";
}

private void Command1_Click(object sender, System.EventArgs e)
{
    Application.Exit();
}

C++

    m_vSftMaskAmount = GetDlgItem(IDC_SFTMASKAMOUNT)->GetControlUnknown();
    _ASSERT(m_vSftMaskAmount != NULL);
    m_vSftMaskIPAddr = GetDlgItem(IDC_SFTMASKIPADDR)->GetControlUnknown();
    _ASSERT(m_vSftMaskIPAddr != NULL);
    m_vSftMaskPswd = GetDlgItem(IDC_SFTMASKPSWD)->GetControlUnknown();
    _ASSERT(m_vSftMaskPswd != NULL);

    // phone number
    m_vSftMaskPhone->Text = _bstr_t(_T("9415058600"));
    m_vSftMaskPhone->SelStart = 1;

    // social security number
    m_vSftMaskSSN->Text = _bstr_t(_T("444-12-1111"));

    // today's date
    m_vSftMaskTodaysDate->Contents->DateTime = COleDateTime::GetCurrentTime();;

See Also SftMask Object | Object Hierarchy


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