' SaneTabs ' ---------------------------------------------------------------------- ' Visual studio has tabbed browsing of source code BUT the hotkeys for ' those tabs (control-tab, etc) move you to the last visted window rather ' than the next tab. This is __very__ annoying. ' ' Installation: ' 1) Open the Macros IDE (Tools menu, Macros, Macros IDE) ' 2) Create a new module or open an existing one ' 3) Copy this code into the module and save ' 4) Assign keyboard shortcuts to the NextTab and PrevTab methods ' a) Tools, Options ' b) Keyboard section ' c) Search for the NextTab/PrevTab macro ' d) Assign a key to it ' ---------------------------------------------------------------------- Sub NextTab() Dim active As EnvDTE.Window = DTE.ActiveWindow Dim i As Integer Dim prev As EnvDTE.Window = Nothing Dim rollover = False For i = 1 To DTE.Windows.Count Dim w As EnvDTE.Window = DTE.Windows.Item(i) If w.Kind = "Document" Then If w Is active And prev Is Nothing Then rollover = True ElseIf w Is active And Not (prev Is Nothing) Then prev.Activate() Return Else prev = w End If End If Next If rollover = True And Not (prev Is Nothing) Then prev.Activate() End If End Sub Sub PrevTab() Dim active As EnvDTE.Window = DTE.ActiveWindow Dim i As Integer Dim prev As EnvDTE.Window = Nothing Dim rollover = False For i = DTE.Windows.Count To 1 Step -1 Dim w As EnvDTE.Window = DTE.Windows.Item(i) If w.Kind = "Document" Then If w Is active And prev Is Nothing Then rollover = True ElseIf w Is active And Not (prev Is Nothing) Then prev.Activate() Return Else prev = w End If End If Next If rollover = True And Not (prev Is Nothing) Then prev.Activate() End If End Sub