Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Fmt1 Sample (VB6)

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

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

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

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

    Dim Year As Integer, Month As Integer, Day As Integer, DayOfWeek As Integer
    SftMask1.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
    SftMask1.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.