Hi guys...
I am using a text box in vb6 application and I have applied validations on it such that it will only accept Numeric data through keyboard.
But the problem is when I try to paste some special characters in it through Mouse Right Click, it gets pasted from clip board.
It happens because I have applied validations on Keypress event.
Let me tell u that CTRL+V (paste through keyboard is also disabled).
Now what I want is either I should trap the Mouse right click event and check if "Paste" option is selected, if it is true then I can use "isnumeric(Clipboard.GetText())" and read data from clipboard and prompt a message that non numeric data present on clip board.
If button = vbRightclick then
7 11337
Hi guys...
I am using a text box in vb6 application and I have applied validations on it such that it will only accept Numeric data through keyboard.
But the problem is when I try to paste some special characters in it through Mouse Right Click, it gets pasted from clip board.
It happens because I have applied validations on Keypress event.
Let me tell u that CTRL+V (paste through keyboard is also disabled).
Now what I want is either I should trap the Mouse right click event and check if "Paste" option is selected, if it is true then I can use "isnumeric(Clipboard.GetText())" and read data from clipboard and prompt a message that non numeric data present on clip board.
If button = vbRightclick then
just lock the textbox in keydown event txt have the property use it
thnx dude I tried same but I need to enter numeric data through keyboard, if we will lock text box it will create problem.
what I thought is to trap the default menu editor and check if the menu item selected is "Paste", if true then we can check data on clipboard if it is numeric then proceed else show msg of invalid data on clip board.
In this implementation I m having problem that I m not able to trap default menu editor and the click of "Paste " option.
can u suggest anything in this respect...
thnx dude I tried same but I need to enter numeric data through keyboard, if we will lock text box it will create problem.
what I thought is to trap the default menu editor and check if the menu item selected is "Paste", if true then we can check data on clipboard if it is numeric then proceed else show msg of invalid data on clip board.
In this implementation I m having problem that I m not able to trap default menu editor and the click of "Paste " option.
can u suggest anything in this respect...
See I'll give u d code tommoro b'coz it's my time to go home so tomoro when i will come i'll give u d code
Trust me
both Ctrl+V and menu Paste will be get disabled
Trust me
You could try a simple brute-force approach. In the Change event, just go through the .Text property and remove any non-numeric characters.
Hi guys...
I am using a text box in vb6 application and I have applied validations on it such that it will only accept Numeric data through keyboard.
But the problem is when I try to paste some special characters in it through Mouse Right Click, it gets pasted from clip board.
It happens because I have applied validations on Keypress event.
Let me tell u that CTRL+V (paste through keyboard is also disabled).
Now what I want is either I should trap the Mouse right click event and check if "Paste" option is selected, if it is true then I can use "isnumeric(Clipboard.GetText())" and read data from clipboard and prompt a message that non numeric data present on clip board.
If button = vbRightclick then
dear i'm with d sol. just try it -
Private Sub Text1_KeyPress(KeyAscii As Integer)
-
CheckCopyPaste Text1, KeyAscii
-
End Sub
-
-
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
CheckCopyPaste Text1, Button
-
End Sub
-
-
Public Sub CheckCopyPaste(txtbox As Object, KeyCode As Integer)
-
If KeyCode <> 22 And KeyCode <> 93 And KeyCode <> 2 Then
-
txtbox.Locked = False
-
Else
-
txtbox.Locked = True
-
End If
-
End Sub
-
Can u not use richtext box tool
Can u not use richtext box tool
While we're on the subject, what about the Masked Edit control?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Lisa |
last post by:
I need to apply the HTML formatting tags and the French accented
characters in a XML document. The XML is generated from a database
that has HTML tags and French accented characters in the records....
|
by: jinu |
last post by:
Hello,
Facing a problem where I use a numericupdown control in vb.net for recieving
an input. But user can copy a "text" using mouse and paste into the
numericupdown control. This will lead to...
|
by: Sakharam Phapale |
last post by:
Hi All,
I am using an API function, which takes file path as an input.
When file path contains special characters (@,#,$,%,&,^, etc), API function
gives an error as "Unable to open input file"....
|
by: Steve |
last post by:
Hi all,
Is it possible to disable pasting from the clipboard into a textbox ?? I
can't find a property for it but I guess it must be possible.
thanks
Steve
|
by: MLH |
last post by:
If I give someone a runtime app,
they can open the database
window by pressing the F-11
key. How to prevent???
|
by: david.lindsay.green |
last post by:
Hello all, I am quite new a web scripting and making web pages in
general and I have stumbled across a problem I have as yet been unable
to solve. I am trying to take the contents of a textarea box...
|
by: sonald |
last post by:
Dear All,
I am working on a module that validates the provided CSV data in a text
format, which must be in a predefined format.
We check for the :
1. Number of fields provided in the text file,...
|
by: Jon |
last post by:
Hi,
I used XslCompiledTransform with the following Xsl file. The <xsl:text
disable-output-escaping="yes"does not work when using XslCompiledTransform
to do the trnasform (namely the output...
|
by: =?Utf-8?B?TWljaGFlbCAwMw==?= |
last post by:
I need to disable the clipboard function in Windows XP. We are having a
problem with users using CTRL+C in one program, then using CTRL+V in another.
Specifically, they type their password into...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |