Search

Window.NextTab and Window.PreviousTab keybindings do not work on Form Designer tabs. by Greg Bray

Resolved
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 571750
Opened: 6/29/2010 3:39:16 PM
Access Restriction: Public
2
Workaround(s)
0
User(s) can reproduce this bug
I prefer using the Window.NextTab as a keybinding for Ctrl+Tab instead of the default as the Most Recently Used (MRU) tab order can be confusing to use. I am able to replace the default Window.NextDocumentWindowNav option with NextTab, and it works fine for code files, but when you switch to a designer tab it stops working. The Ctrl+F6 keybinding for Window.NextDocumentWindow works fine on designer tabs, but it still uses MRU ordering. I tried other keybindings for NextTab like the default Ctrl+PgDn but they also do not work. The same issue occurs for Window.PreviousTab.
Details (expand)

Product Language

English

Visual Studio Version

Visual Studio 2010

Operating System

Windows 7

Operating System Language

English (US)

Steps to Reproduce

-Replace default Ctrl+Tab and Ctrl+Shift+Tab global keybindings with Window.NextTab and Window.PreviousTab.

-Open multiple code files

-Tab through files works correctly with non-MRU ordering.

-Open Designer file and try to tab through it.

Actual Results

Once you switch to the designer file the Ctrl+Tab and Ctrl+Shift+Tab keys stop working. The Ctrl+F6 option still works but that uses MRU ordering

Expected Results

Switch to the next tab using Non-MRU ordering.

This macro works: http://www.mrspeaker.net/2006/10/12/tab-un-stupidifier/

Many others want to use non-MRU ordering: http://stackoverflow.com/questions/21027
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey.

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 8/3/2010 at 4:50 PM
This will be fixed in the next Visual Studio release. The Window.NextTab and Window.PreviousTab commands will be implemented to work in a consistent way for both toolwindows and documents.

Thank you for reporting this issue,
Alin Constantin
[VS Pro Development]
Posted by Greg Bray on 7/21/2010 at 9:34 AM
Thanks for the great write-up of the problem! I actually end up setting the left sweep and right sweep of the scroll wheel of my mouse to Ctrl+Tab and Ctrl+Shift+Tab so that I can quickly switch between tabs/documents in multiple programs, so for me at least the best solution would be if Window.NextTab worked with all window types and could be bound to the standard Tab shortcut keys. Right now I use a macro (see workarounds tab above) and it works reasonably well, but after searching around it sounds like there are many others that would like non-MRU tab switching too. Adding this to the next release of Visual Studio or as an option in the Visual Studio 2010 Productivity Power Tools would be greatly appreciated.

Thanks again for the response, and keep up the great work!
Posted by Microsoft on 7/20/2010 at 3:00 PM
Thank you for reporting this issue. This is actually "By design" for Visual Studio 2010.

The Window.NextTab and Window.PreviousTab keybindings don't work currently on FormDesiger tabs because they are not supposed to. These commands are specific to toolwindows in a tab group (e.g. SolutionExplorer/TeamExplorer/ClassView) and they activate the previous/next toolwindow in the tab group.

If you try the same scenario in Visual Studio 2008 or older you'll see the Ctrl+Tab bound to Window.NextTab doesn't work even for simple text documents.

In Visual Studio 2010, Ctrl+Tab bound to Window.NextTab changes the active tab when the active document is a text editor, but not because it's bound to Window.NextTab.
When Ctrl+Tab is pressed in a txt editor, the key is not translated to any of the keybindings (and it's not translated to Window.NextTab either because the active window is not a toolwindow in a tab group). The WM_KEYDOWN message sent by Windows to the main window is passed to WPF and it used WPF-style events for keybinding that start with the editor and bubble up the visual tree. Since the editor in VS10 is fully implemented as a WPF-window with no intervening HWNDs, the keydown events reach eventually the TabControl of the document well area, where WPF uses Ctrl-Tab to switch the active view in the tab control. This is the default key treatment of the WPF System.Windows.Controls.TabControl, so the fact that your scenario worked in VS10 for text documents is merely due to a fortunate implementation detail.

Other editors (like the Winforms designer, or even text-based editors like the BinaryEditor) are not implemented using WPF control. Pressing key combinations in such editors generate WM_KEYDOWN events that are sent to the editor window, and it's up to the editor to do whatever they want with it. E.g. The Binary Editor will move focus between the hexadecimal and ASCII display zones when Ctrl+Tab/Ctrl+Shift+Tab is pressed. The keys never reach the WPF main window, they are not translated to WPF-style events and the TabControl doesn't get to change the active tab.

That being said, we agree this design of having Window.NextTab and Window.PreviousTab specific to toolwindows is not ideal. Nothing in the commands names suggest these commands work only in a toolwindow.
We also realize the need of being able to switch document tabs in an order that's not MRU-dependent.

We don't see any reason why Window.NextTab and Window.PreviousTab commands can't be reused to work for document windows, too, so we will change this design in next Visual Studio version, and allow the Window.Previous/NextTab commands to change the active tab in both documents and toolwindows.

Thank you,
Alin Constantin
[Visual Studio Pro development]
Posted by Microsoft on 6/29/2010 at 7:38 PM
Thank you for reporting the issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by Microsoft on 6/29/2010 at 5:06 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Greg Bray on 6/29/2010 at 3:40 PM
Use this macro instead of Window.NextTab:
http://www.mrspeaker.net/2006/10/12/tab-un-stupidifier/

More info:
http://stackoverflow.com/questions/21027
Posted by Greg Bray on 11/4/2010 at 10:42 AM
The Productivity Power Tools now also include Window.NextDocumentWellTab and Window.PreviousDocumentWellTab commands that will cycle left or right through the documents.

More info:

http://stackoverflow.com/questions/21027/changing-ctrltab-behavior-for-moving-between-document-in-visual-studio/4099033#4099033