By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,081 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

how to capture keypress for Printscreen

chanderravi
P: 7
Hello

How can I disable "Printscreen" action (ie capture screen) from my vb application.


Thanks
Ravi
Sep 21 '07 #1
Share this Question
Share on Google+
5 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Make Form's KeyPreview=True
and :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  2.    If KeyCode = 44 Then
  3.          MsgBox "Print Screen Pressed"
  4.    End If
  5. End Sub
  6.  
REgards
Veena
Sep 21 '07 #2

chanderravi
P: 7
thanks for the reply

how can I capture the same at MDI form level

Thanks
Ravi
Sep 21 '07 #3

QVeen72
Expert 100+
P: 1,445
Hi,

MDIForm doesnt support any KeyPress Events.
there is a way around. Place a PictureBox on MDI Form and Set It's property "FillStyle =Transparent". (to show MDI's Picture/colour bckgrnd)

Now In MDI FormLoad event, make size of PictureBox = size of MDI Form (Width and Height). U can write the code in Re-Size Event also.

And write the Key Capture Code for Picrure1_KeyUp event.

Regards
Veena
Sep 21 '07 #4

chanderravi
P: 7
Thanks, I shall try if this suits my requirement

Thanks
Ravi

Hi,

MDIForm doesnt support any KeyPress Events.
there is a way around. Place a PictureBox on MDI Form and Set It's property "FillStyle =Transparent". (to show MDI's Picture/colour bckgrnd)

Now In MDI FormLoad event, make size of PictureBox = size of MDI Form (Width and Height). U can write the code in Re-Size Event also.

And write the Key Capture Code for Picrure1_KeyUp event.

Regards
Veena
Sep 21 '07 #5

Expert 5K+
P: 8,434
Good luck, but I think you'll find the PrintScreen key is not handled like other keys.
Sep 23 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.