|
-
May 18th, 2000, 02:08 AM
#1
Thread Starter
New Member
How do I disable the Print Screen Key?
I'm trying this:
Private Sub txtText_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyPrint or KeyCode = vbKeySnapshot then
KeyCode = 0
End If
End Sub
But, when I press the Print Screen Key the event isn't fired. *ONLY* with Print Screen Key!!!
Thanks in advance,
Piazza
-
May 18th, 2000, 05:30 AM
#2
Well, basically the Print Screen key saves the screen to the Clipboard. So all you really have to do is clar the Clipboard. Try this code, below.
Code:
Private Sub txtText_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyPrint or KeyCode = vbKeySnapshot then
Clipboard.Clear
End If
End Sub
What I have done is just emptied the Clipboard after the screen was copied to it. I don't know if this is what you anted or not.
-
May 18th, 2000, 06:23 AM
#3
Fanatic Member
This also works too!
If I am not wrong, Piazza wants to disable the "Print Screen" Key because he still wants to keep the previous data on the clipboard. "Clipboard.Clear" will clear everything.
Therefore, inorder to still keep the previous data on the clipboard use:
Code:
Private Sub txtText_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyPrint or KeyCode = vbKeySnapshot then
Keycode = 0
End If
End Sub
-
May 18th, 2000, 06:58 AM
#4
I was somewhat debating about that before my previous reply. In any case, he has both answers right here.
-
May 18th, 2000, 07:18 AM
#5
Fanatic Member
Actually, careless of me, the answer I posted was also his original answer.
Piazza is right, the event doesn't get fire when you press "Print Screen" key. I placed a break and it never fired the event. Therefore, both of our answer would not work. Hum! Let me see why!
Do you have any idea Megatron?
Chemically Formulated As:
Dr. Nitro
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|