|
-
Dec 3rd, 2005, 09:34 PM
#1
Thread Starter
Fanatic Member
Del + Shift Key
how do you press the "Shift+Delete" Key from your app.
-
Dec 3rd, 2005, 09:42 PM
#2
Re: Del + Shift Key
Perhaps via SendKeys:
VB Code:
Private Sub Command1_Click()
SendKeys "+{DEL}"
End Sub
-
Dec 3rd, 2005, 11:45 PM
#3
Frenzied Member
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.
-
Dec 3rd, 2005, 11:50 PM
#4
Fanatic Member
Re: Del + Shift Key
This is perhaps the greatest way to do it ever 
VB Code:
Option Explicit
Dim KeyDelete As Boolean
Dim KeyShift As Boolean
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
Select Case KeyCode
Case vbKeyShift
If Not KeyDelete Then KeyShift= True
Case vbKeyDelete
If KeyShift Then
KeyDelete = True
ElseIf Not KeyShift Then
KeyDelete = False
End If
End Select
If KeyShift And KeyDelete Then
Make me a sandwhich.
KeyShift = False
KeyDelete = False
End If
End Sub
Last edited by paralinx; Dec 3rd, 2005 at 11:53 PM.
-
Dec 4th, 2005, 06:07 AM
#5
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 ?
-
Dec 6th, 2005, 06:00 PM
#6
Thread Starter
Fanatic Member
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.
-
Dec 6th, 2005, 06:16 PM
#7
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.
-
Dec 6th, 2005, 10:08 PM
#8
Thread Starter
Fanatic Member
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.
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
|