Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

UpdateMonth Event, SftMask Object

A new month is displayed.

Syntax

VB.NETPrivate Sub object_UpdateMonth(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.UpdateMonth
VBPrivate Sub object_UpdateMonth(ByVal Dt As Date)
C#.NETvoid object_UpdateMonth(object sender, EventArgumentType e);
VC++void OnUpdateMonthobject(DATE Dt);
CHRESULT OnUpdateMonthobject(DATE Dt);

object

A SftMask object.

Dt

Defines the starting date of the calendar currently displayed.

Comments

The UpdateMonth event occurs when a new month is displayed.

This event can be used to define specific dates to be displayed with a bold font using the Calendar.BoldDate.

The starting Date Dt is not necessarily equivalent to the current month being displayed, as the calendar display usually includes a few days of the prior month. It should be assumed that the actual month displayed is within the range Dt to Dt + 2 months. When updating the calendar display using the Calendar.BoldDate property, the entire 3 month range should be updated.

On entry to the UpdateMonth event, no dates are highlighted. The BoldDate property must be used for all dates to be highlighted. The next UpdateMonth event occurs when the user selects a new month and all highlighted dates are cleared.

This event cannot be used to modify other control properties or invoke control methods.

Examples

VB.NET

    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#
End Sub

Private Sub AxAxSftMask1_UpdateMonth(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_UpdateMonthEvent) Handles AxSftMask1.UpdateMonth
    AxSftMask1.Calendar.BoldDate = #1/2/2007#
    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

VB6

    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#
End Sub

Private Sub SftMask1_UpdateMonth(ByVal Dt As Date)
    SftMask1.Calendar.BoldDate = #1/2/2007#
    SftMask1.Calendar.BoldDate = #1/9/2007#
    SftMask1.Calendar.BoldDate = #1/16/2007#
    SftMask1.Calendar.BoldDate = #1/23/2007#
    SftMask1.Calendar.BoldDate = #1/30/2007#
End Sub

C#

    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);
}

private void axSftMask1_UpdateMonth(object sender, AxSftMaskLib70._ISftMaskEvents_UpdateMonthEvent e)
{
    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 2);
    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 9);
    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 16);
    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 23);
    axSftMask1.Calendar.BoldDate = new DateTime(2007, 1, 30);
}

C++

    m_pMask1->Caption->Position = positionSftMaskTop;
    m_pMask1->Caption->BackColor = COLOR_HIGHLIGHT | 0x80000000L;
    m_pMask1->Caption->ForeColor = COLOR_HIGHLIGHTTEXT | 0x80000000L;

    m_pMask1->Contents->DateTime = COleDateTime(2007, 1, 1, 0,0,0);
    return TRUE;
}

void CProject1Dlg::OnUpdateMonthSftMask1(DATE Dt)
{
    m_pMask1->Calendar->BoldDate = COleDateTime(2007, 1, 2, 0,0,0);
    m_pMask1->Calendar->BoldDate = COleDateTime(2007, 1, 9, 0,0,0);
    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);
}

See Also SftMask Events | Object Hierarchy


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