Results 1 to 8 of 8

Thread: Del + Shift Key

  1. #1

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Del + Shift Key

    how do you press the "Shift+Delete" Key from your app.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  2. #2

  3. #3
    Frenzied Member
    Join Date
    May 2003
    Location
    Sydney
    Posts
    1,123

    Re: Del + Shift Key

    why do u want it? to delete file without sending to recycle bin? if so u can use file system object for the same.

  4. #4
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Del + Shift Key

    This is perhaps the greatest way to do it ever


    VB Code:
    1. Option Explicit
    2.     Dim KeyDelete As Boolean
    3.     Dim KeyShift As Boolean
    4.  
    5. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    6.     On Error Resume Next
    7.         Select Case KeyCode
    8.             Case vbKeyShift
    9.                 If Not KeyDelete Then KeyShift= True
    10.             Case vbKeyDelete
    11.                 If KeyShift Then
    12.                     KeyDelete = True
    13.                 ElseIf Not KeyShift Then
    14.                     KeyDelete = False
    15.                 End If
    16.         End Select
    17.         If KeyShift And KeyDelete Then
    18.             Make me a sandwhich.
    19.             KeyShift = False
    20.             KeyDelete = False
    21.         End If
    22. End Sub
    Last edited by paralinx; Dec 3rd, 2005 at 11:53 PM.

  5. #5
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Del + Shift Key

    A simple Kill Statement will delete a file without sending it to recyclebin.
    Why do you want to send the keystrokes ?

  6. #6

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: Del + Shift Key

    nope, i'm not using it to delete a file but instead it's suppose to be a shortcut key in my app.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

  7. #7
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Del + Shift Key

    Then I think the code paralinx posted should do the job. If you are interested in slightly more advanced solution that uses hooking you can look into this code from vbAcceleartor. The download is in the navigation bar on the left of the page.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  8. #8

    Thread Starter
    Fanatic Member modpluz's Avatar
    Join Date
    Sep 2005
    Location
    Lag, NG
    Posts
    633

    Re: Del + Shift Key

    i'll be using the vbaccelerator's control... i seem to like it -

    thanks paralinx
    Last edited by modpluz; Dec 6th, 2005 at 10:12 PM.
    If you want the rabbit to hop, move the carrot - Paul Kellerman(Prison Break)

    onError GoTo http://vbforums.com



    My Bits:
    VB6: Change Column Name in MS ACCESS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width