I like dark backgrounds when I code; my co-workers don’t. I want to be able to change the screen back and forth from Darkness and Light. So I created a couple of toolbar buttons to switch themes (don’t use the tool until I say you can do so).
- I save my current theme (Tools => Import and Export Settings… => Export … => Next => Next => "C:\VS_Themes\Darkness.vssettings" => Finish).
- Create a standard theme (Tools => Import and Export Settings… => Reset all Settings).
- Save the standard theme (same steps as 1 but call it "C:\VS_Themes\Default.vssettings")
- Open Macros IDE (((Alt+F11) || (Tools => Macros => Macros IDE …))
- Create a module (Right Click on MyMacros => Add => Add Module => Name it "LoadThemes")
- Type the following VB.NET code into the module:
- And I hooked them to buttons on my tookbar (Tools => Customize => New… "Theme" => Commands => Select Macros => Drag your macros onto the new Toolbar).
- Resave the Darkness Theme (The toolbar is part of the theme, otherwise when you use the tool bar to switch themes, you will lose the toolbar)
- Do the same thing for the Default Theme.
Public Module LoadThemes Public Sub SetThemeToDarkness() LoadThemeByFilename("C:\VS_Themes\Darkness.vssettings") End Sub< Public Sub SetThemeToDefault() LoadThemeByFilename("C:\VS_Themes\Default.vssettings") End Sub< Private Sub LoadThemeByFilename(ByVal fileName As String) DTE.ExecuteCommand("Tools.ImportandExportSettings", "/import:""" & fileName & """") End Sub End Module
Now you are set.
No comments:
Post a Comment