Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Sample1 Sample (VB.NET)

This sample illustrates various Masked Edit controls.

The source code is located at C:\Program Files (x86)\Softelvdm\SftMask OCX 7.0\Samples\Visual Studio - VB.NET\Sample1\Form1.vb or C:\Program Files\Softelvdm\SftMask OCX 7.0\Samples\Visual Studio - VB.NET\Sample1\Form1.vb (on 32-bit Windows versions).

Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
    End
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    SftMaskPhone.Text = "9415058600" ' our phone number
    SftMaskPhone.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectHome ' set the input location
    SftMaskSSN.Text = "444-12-1111" ' a social security number
    SftMaskToday.Contents.DateTime = Today ' set today's date
    SftMaskTime.Contents.DateTime = TimeOfDay
    SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent
    SftMaskAmount.Text = CStr(199)
    SftMaskIPAddr.Text = "209.61.201.49"
End Sub

Private Sub SftMaskAmount_UpDownPress(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_UpDownPressEvent) Handles SftMaskAmount.UpDownPress
    Dim Amount As Double
    Dim Increment As Single
    If e.counter = 0 Or e.counter > 5 Then
        Amount = Val(e.field)
        Increment = 0.01
        If e.counter > 14 Then Increment = 0.1
        If e.counter > 23 Then Increment = 1
        If e.counter > 52 Then Increment = 10
        If e.up Then
            Amount = Amount + Increment
        Else
            Amount = Amount - Increment
        End If
        If Amount > 99999.99 Then Amount = 99999.99
        If Amount < -99999.99 Then Amount = -99999.99
        e.field = Format(Amount, "##,##0.00")
    End If
End Sub

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