Creating Short cut keys in windows forms

Hi,
We are trying to migrate a project from VB to VB.NET. Lot of short cut keys have been used for buttons in Visual Basic. how do we implement the short cut keys in VB.NET windows forms

Thanks,
Kris



Answer this question

Creating Short cut keys in windows forms

  • ChrisFrick

    Shortcut keys are really quite simple to implement in VB

    To provide save a short-cut keys on a button as an example, for the text property place a & character immediately prior to the character you want to be the shortcut key.

    So if you have two buttons which you want to be Save and Load, then the respective text properties for these buttons will be &Save and &Load

    And then code in you usual stuff in the button click event.

    The same applies to most all windows controls on the form.  Be careful to avoid clashes - more than one control on a form using the same shortcut.

     For the tab control its a bit more problematic and

    http://www.dotnetforums.net/printthread.php t=81953

    details some possible workaround.

     


  • Young Joo-MSFT

    I just forgot to add that we need hot key functionality for tab controls in windows forms. How do we implement this

    Thanks,
    Kris


  • Creating Short cut keys in windows forms