Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

LastDate Property, SftMaskCalendar Object

Defines the last valid date.

Syntax

Get

VB.NETLast = object.LastDate As Date
VBLast = object.LastDate As Date
C#.NETSystem.DateTime Last = object.LastDate;
VC++DATE Last = object->LastDate;
DATE Last = object->GetLastDate();
CHRESULT object->get_LastDate(DATE* Last);

Put

VB.NETobject.LastDate = Last As Date
VBobject.LastDate = Last As Date
C#.NETSystem.DateTime object.LastDate = Last;
VC++DATE object->LastDate = Last;
void object->PutLastDate(DATE Last);
CHRESULT object->put_LastDate(DATE Last);

object

A SftMaskCalendar object.

Last

Defines the last valid date to be entered or selected by the user.

Comments

The LastDate property defines the last valid date.

The edit control contents are not considered valid (see Contents.ValidMsg) until the date is within the specified range. The user cannot select a date outside of the date range defined using Calendar.FirstDate and LastDate using the popup calendar.

If the date defined using LastDate is prior to the date defined using Calendar.FirstDate, the range LastDate to Calendar.FirstDate is considered the valid range.

Examples

VB.NET

    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
    AxSftMask1.Caption.Text = "&Ship Date"
    AxSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskCenter
    AxSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskTop
    AxSftMask1.Caption.BackColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.Highlight) And &HFFFFFFFF&)
    AxSftMask1.Caption.ForeColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.HighlightText) And &HFFFFFFFF&)
    AxSftMask1.Contents.DateTime = #1/1/2007#

VB6

    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
    SftMask1.Caption.Text = "&Ship Date"
    SftMask1.Caption.Alignment = alignSftMaskCenter
    SftMask1.Caption.Position = positionSftMaskTop
    SftMask1.Caption.BackColor = vbHighlight
    SftMask1.Caption.ForeColor = vbHighlightText
    SftMask1.Contents.DateTime = #1/1/2007#

C#

    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);
    axSftMask1.Calendar.ShowToday = true;
    axSftMask1.Caption.Text = "&Ship Date";
    axSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskCenter;
    axSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskTop;
    axSftMask1.Caption.BackColor = (uint) ColorTranslator.ToOle(SystemColors.Highlight);
    axSftMask1.Caption.ForeColor = (uint) ColorTranslator.ToOle(SystemColors.HighlightText);
    axSftMask1.Contents.DateTime = new DateTime(2007, 1, 1);

C++

    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;

    COleDateTime first(2000, 1, 1, 0,0,0);
    m_pMask1->Calendar->FirstDate = first;
    COleDateTime last(2020, 12, 31, 0,0,0);
    m_pMask1->Calendar->LastDate = last;
    m_pMask1->Calendar->ShowToday = VARIANT_TRUE;
    m_pMask1->Caption->Text = _T("&Ship Date");
    m_pMask1->Caption->Alignment = alignSftMaskCenter;
    m_pMask1->Caption->Position = positionSftMaskTop;
    m_pMask1->Caption->BackColor = COLOR_HIGHLIGHT | 0x80000000L;
    m_pMask1->Caption->ForeColor = COLOR_HIGHLIGHTTEXT | 0x80000000L;

See Also SftMaskCalendar Object | Object Hierarchy


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