Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

Sample1 Sample (VB6)

This sample illustrates various Masked Edit controls.

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

Option Explicit

Private Sub Command1_Click()
    End
End Sub

Private Sub Form_Load()
    SftMaskPhone.Text = "9415058600" ' our phone number
    SftMaskPhone.SelStart = 1  ' set the input location
    SftMaskSSN.Text = "444-12-1111" ' a social security number
    SftMaskToday.Contents.DateTime = Date ' set today's date
    SftMaskTime.Contents.DateTime = Time
    SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent
    SftMaskAmount.Text = 199
    SftMaskIPAddr.Text = "209.61.201.49"
End Sub

Private Sub SftMaskAmount_UpDownPress(ByVal Up As Boolean, ByVal FieldStart As Long, ByVal FieldEnd As Long, ByVal Counter As Long, Field As String)
    Dim Increment As Single
    If Counter = 0 Or Counter > 5 Then
        If Val(Field) = 0 Then
            Field = 0
        End If
        Increment = 0.01
        If Counter > 14 Then Increment = 0.1
        If Counter > 23 Then Increment = 1
        If Counter > 52 Then Increment = 10

        If Up Then
            Field = Field + Increment
        Else
            Field = Field - Increment
        End If
        If Field > 99999.99 Then Field = 99999.99
        If Field < -99999.99 Then Field = -99999.99
        Field = Format(Field, "####0.00")
    End If
End Sub

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