Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

DateTime Property, SftMaskContents Object

Defines the date and time field contents.

Syntax

Get

VB.NETDt = object.DateTime As Date
VBDt = object.DateTime As Date
C#.NETSystem.DateTime Dt = object.DateTime;
VC++DATE Dt = object->DateTime;
DATE Dt = object->GetDateTime();
CHRESULT object->get_DateTime(DATE* Dt);

Put

VB.NETobject.DateTime = Dt As Date
VBobject.DateTime = Dt As Date
C#.NETSystem.DateTime object.DateTime = Dt;
VC++DATE object->DateTime = Dt;
void object->PutDateTime(DATE Dt);
CHRESULT object->put_DateTime(DATE Dt);

object

A SftMaskContents object.

Dt

A Date value defining all date and time related fields of the defined mask (see Mask property).

Comments

The DateTime property defines the date and time field contents.

The DateTime property can be used to retrieve and set portions of a Masked Edit control's contents without knowing the exact position of the data. All date and time related fields of the mask are affected.

When setting the DateTime property, the date defined using Val replaces the current contents of any date and time related fields of the mask.

Other portions of the mask can be retrieved and set using the Contents.Value property.

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

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

Private Sub SftMaskAmount_UpDownPress(ByVal Up As Boolean, ByVal FieldStart As Long, ByVal FieldEnd As Long, ByVal Counter As Long, Field As String)

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++

    // 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();;

    // time
    m_vSftMaskTime->Contents->DateTime = COleDateTime::GetCurrentTime();;

    // percentage
    m_vSftMaskPercent->Contents->Value[0] = COleVariant(50L);

See Also SftMaskContents Object | Object Hierarchy


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