Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Fmt1 Sample (VB.NET)

This sample illustrates date, time and number formatting.

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
    Dim FmtVal As String
    AxSftMask1.Calculator.FormatCurrency(48533.85, -1, -1, -1, "", "", -1, -1, "", FmtVal)
    MsgBox(FmtVal)

    Dim Text As String
    Text = "short"
    AxSftMask1.Calendar.FormatDate(#8/1/2000#, Text)
    MsgBox(Text)
    Text = "long"
    AxSftMask1.Calendar.FormatDate(#8/1/2000#, Text)
    MsgBox(Text)
    Text = "dddd, MMMM d 'in the year' yyyy"
    AxSftMask1.Calendar.FormatDate(#8/1/2000#, Text)
    MsgBox(Text)

    AxSftMask1.Calculator.FormatNumber(48533.85, -1, -1, -1, "", "", -1, FmtVal)
    MsgBox(FmtVal)

    Text = ""
    AxSftMask1.Calendar.FormatTime(#5:01:59 PM#, Text)
    MsgBox(Text)
    Text = "'Hour='H 'Mins='m 'Secs='s"
    AxSftMask1.Calendar.FormatTime(#5:01:59 PM#, Text)
    MsgBox(Text)

    Dim Year As Integer, Month As Integer, Day As Integer, DayOfWeek As Integer
    AxSftMask1.Calendar.GetDateInfo(#7/14/2006 5:49:23 PM#, Year, Month, Day, DayOfWeek)
    MsgBox("Year=" & Year & " Month=" & Month & " Day=" & Day & " DayOfWeek=" & DayOfWeek)

    Dim Hours As Integer, Minutes As Integer, Seconds As Integer
    AxSftMask1.Calendar.GetTimeInfo(#7/14/2002 5:49:23 PM#, Hours, Minutes, Seconds)
    MsgBox("Hours=" & Hours & " Minutes=" & Minutes & " Seconds=" & Seconds)
End Sub

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