how to capture keypress for Printscreen

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chanderravi
    New Member
    • Sep 2007
    • 7

    how to capture keypress for Printscreen

    Hello

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


    Thanks
    Ravi
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Make Form's KeyPreview=True
    and :

    [code=vb]
    Private Sub Form_KeyUp(KeyC ode As Integer, Shift As Integer)
    If KeyCode = 44 Then
    MsgBox "Print Screen Pressed"
    End If
    End Sub
    [/code]

    REgards
    Veena

    Comment

    • chanderravi
      New Member
      • Sep 2007
      • 7

      #3
      thanks for the reply

      how can I capture the same at MDI form level

      Thanks
      Ravi

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        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

        Comment

        • chanderravi
          New Member
          • Sep 2007
          • 7

          #5
          Thanks, I shall try if this suits my requirement

          Thanks
          Ravi

          Originally posted by QVeen72
          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

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Good luck, but I think you'll find the PrintScreen key is not handled like other keys.

            Comment

            Working...