ShortcutKeys

6 posts, 0 answers
  1. Juan Pablo
    Juan Pablo avatar
    19 posts
    Member since:
    Oct 2008

    Posted 06 Jan 2009 Link to this post

    Hello!

    When I use the default menu in a Windows Form application I can do something like this:
                this.myToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));

    Is there any way to do something like that with your menu controls?

    Thaks in advance for your help.

  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 07 Jan 2009 Link to this post

    Hi Juan Pablo,

    Thank you for the question.

    Yes, you can assign key chords on our RadMenuItems as well. However, the programmatic approach is a bit different. Please refer to the following code snippet:
    ChordModifier chordModifier = new ChordModifier();  
    chordModifier.ControlModifier = true;  
    Chord chord = new Chord();  
    chord.ChordModifier = chordModifier;  
    chord.Keys = "Ctrl+Q";  
    ClickCommand activateMenuItemCommand = new ClickCommand();  
    InputBinding inputBinding = new InputBinding(activateMenuItemCommand, chord, this.radMenuItem1);  
    this.radMenu1.CommandBindings.Add(inputBinding); 

    The above snippet will 'Click' RadMenuItem1, if you key press Ctrl+Q.

    However, if RadMenuItem is a main menu item and you want to open its drop down menu, you will need the ActivateMenuItemCommand:
    ChordModifier chordModifier2 = new ChordModifier();  
    chordModifier2.ControlModifier = true;  
    Chord chord2 = new Chord();  
    chord2.ChordModifier = chordModifier2;  
    chord2.Keys = "Ctrl+P";  
    ActivateMenuItemCommand activateMenuItemCommand2 = new ActivateMenuItemCommand();  
    InputBinding inputBinding2 = new InputBinding(activateMenuItemCommand2, chord2, this.radMenuItem1);  
    this.radMenu1.CommandBindings.Add(inputBinding2); 

    You can easily assign key chords using the designer. Just select RadMenuItem1 and in the Visual Studio property grid, navigate to CommandBinding property.

    I hope this helps. If you have additional questions, feel free to contact me.

    Sincerely yours,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Eric
    Eric avatar
    4 posts
    Member since:
    Dec 2008

    Posted 13 Oct 2009 Link to this post

    Hi,
    I have the latest Winforms revision and even with the previous one I had and still have the following issue:

    I am using a RibbonBar, when I try to select the property CommandBinding on a radMenuItem or a radButtonElement, I have an error (see attached screen capture).

    I would like to be able to set keys via Designer instead of using code.

    Any work around? or fix?
  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 16 Oct 2009 Link to this post

    Hi Eric,

    Thank you for the question.

    We believe that you have already addressed the issue that you experience in our latest Internal Build 2009.2.9.903. Please download it and give it a try. If you continue experiencing the described behavior, please provide us with the exact steps that lead you to the error message.

    Greetings,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Eric
    Eric avatar
    4 posts
    Member since:
    Dec 2008

    Posted 19 Oct 2009 Link to this post

    Hi Nikolay,
    I did install the version 2009.2.9.903 using the RadControls_for_WinForms_2009_2_9_903_dev.zip and it fix my issue with CommandBindings property!

    For your information, the file RadControlsForWinForms.exe in your latest Internal Builds is not the version 2009.2.9.903 but 2009.2.9.8xx version that was not fixing my issue with Command Bindings. I tried this one first...

    Eric
  7. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 28 Oct 2009 Link to this post

    Hello Eric,

    Thank you for your feedback.

    We decided to keep the history of the internal builds. This is why you have found both 2009.2.9.903 and 2009.2.9.804 internal builds with their respective release notes. This allows you to review the main issues addressed in every build. However, I think understand your point of view. We will consider including the version number in the file name of the installers, but not only in the file name of the archive files.

    Kind regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for WinForms is Visual Studio 2017 Ready