Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling two keys

Status
Not open for further replies.

maha12

Programmer
Sep 8, 2002
79
LK
Hello All

In a TextBox how to use Shift+Del keys together
ex:I want to pop up a msgbox if a user press Shift and Del keys together

Tks
Maha
 
In your form, set the keypreview property to true then paste this code into your form.

Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    Select Case Shift
        Case 1
            Select Case KeyCode
                Case 46
                    MsgBox "You pressed SHIFT-DELETE"
            End Select
    End Select

End Sub

Hope this helps.



***You can't change your past, but you can change your future***
 
Dear wraygun,

Its working. Pls tell me what does that case 1 meant and what are the other values.

tks
Maha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top