VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



To Restrict the user to Paste Character value to Numeric Text Box using Mouse right click. Good Sim

by Raghuraja. C (21 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 17th February 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

To Restrict the user to Paste Character value to Numeric Text Box using Mouse right click. Good Simple Logic

Rate To Restrict the user to Paste Character value to Numeric Text Box using Mouse right click. Good Sim



'-------------------------------------------------
Private Sub txtAmount_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call fnChkClip
End Sub
'-------------------------------------------------
Private Sub txtAmount_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call fnChkClip(True)
End Sub
'-------------------------------------------------
Public Sub fnChkClip(Optional blnStore As Boolean)
    'To restrict the Copy Paste if it is String
    On Error GoTo LOCALERRORHANDLER
    '------------------------------------------
    If blnStore Then
        If CLIPTEXT <> "" Then
            Clipboard.SetText CLIPTEXT
            CLIPTEXT = ""
        End If
    '------------------------------------------
    Else
        If IsNumeric(Clipboard.GetText) Then
            CLIPTEXT = ""
        Else
            '------------------------------------------
            If Trim(Clipboard.GetText) <> "" Then
                CLIPTEXT = Clipboard.GetText
                Clipboard.Clear
            End If
        End If
    End If
LOCALERRORHANDLER:
End Sub

Download this snippet    Add to My Saved Code

To Restrict the user to Paste Character value to Numeric Text Box using Mouse right click. Good Sim Comments

No comments have been posted about To Restrict the user to Paste Character value to Numeric Text Box using Mouse right click. Good Sim. Why not be the first to post a comment about To Restrict the user to Paste Character value to Numeric Text Box using Mouse right click. Good Sim.

Post your comment

Subject:
Message:
0/1000 characters