Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
TabControl: How to use control-pageup/pagedown to switch tabs instead of ctrl-tab?
posted

Is there a way I enable users to switch tabs in a tab control using control-pageup/pagedown (as in Chrome), so I can free up control-tab for use in the body of the tab?  Do I have to write a previewKeyDown or something, switch tabs programmatically and set event.Handled = true?  In that case, how do I stop xamTabControl from interfering with the ctrl-tab keypress?

Thanks.

John.

Parents
No Data
Reply
  • 16495
    Offline posted

    Hello John,

     

    Thank you for your post.

     

    I have been looking into your requirements. What I can suggest is to handle the PreviewKeyDown event of XamTabControl and set the IsTabStop  wpf property. To stop the Ctrl + Tab combination you can use  Keyboard.Modifiers method in 'if' statement in the event handler  and set e.handled to true. Also you can move the tabs with PageUp and PageDown buttons by checking in the event handler for it and change the selected item by changing the selected index. You can change it by using  SelectedIndex property of XamTabControl. I created a short sample application to show you how you can achieve the functionality that you want. Please let me know if I missing something.

     

    Please let me know if you need from any further assistance on this matter.

    pageup-down.zip
Children