Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Date1 Sample (VB.NET)

This sample illustrates a popup calendar with validation.

This is not an executable sample, so a complete project is not provided. These statements are intended to show basic concepts and the syntax used.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AxSftMask1.Mask = "$D"
    AxSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskLeft
    AxSftMask1.EditStyle = SftMaskEditStyleConstants.editSftMaskCalendarDropDown
    AxSftMask1.AutoAdvance = True
    AxSftMask1.TabAdvance = True
    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#
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

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim test As Boolean
    test = AxSftMask1.Contents.ValidMsg
End Sub

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