how do you press the "Shift+Delete" Key from your app.
Printable View
how do you press the "Shift+Delete" Key from your app.
Perhaps via SendKeys:
VB Code:
Private Sub Command1_Click() SendKeys "+{DEL}" End Sub
why do u want it? to delete file without sending to recycle bin? if so u can use file system object for the same.
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
A simple Kill Statement will delete a file without sending it to recyclebin.
Why do you want to send the keystrokes ?
nope, i'm not using it to delete a file but instead it's suppose to be a shortcut key in my app.
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.
i'll be using the vbaccelerator's control... i seem to like it -:)
thanks paralinx