CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2001
    Location
    Karachi
    Posts
    91

    Capturing delete key and assinging access key to toolbar's button

    Hi All

    just wanna ask that how would you capture the delete key in you visual basic programm. i tried Ascii but it doest recognize the delete key ..

    So if i wanted to know that if user has presses delete key what would i would do my coding to perform a perticular task

    and yes one more question that how would i assign a access key to toolbar's buttons

    Hoping for your valuable suggestions

    Kirun

    Faults are thick where love is thin

  2. #2
    Join Date
    Jul 2001
    Location
    Trivandrum, Kerala, India
    Posts
    21

    Re: Capturing delete key and assinging access key to toolbar's button


    Dear Kirun,

    write the code in key down event of form rather than key press event. Also, make sure KeyPreview propery of the form is set to true.

    The following code displays a message box when you press delete key.

    private Sub Form_KeyDown(KeyCode as Integer, _
    Shift as Integer)
    If KeyCode = vbKeyDelete then
    MsgBox "Delete key is pressed.", _
    vbExclamation
    End If
    End Sub




    Hope this will work

    All the best.

    Kishore.


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

Featured