Click here to Skip to main content
13,455,659 members (49,877 online)
Click here to Skip to main content
Add your own
alternative version


10 bookmarked
Posted 26 Mar 2009

Close the Start Page Add-In for Visual Studio

, 26 Mar 2009
Rate this:
Please Sign up or sign in to vote.
A custom Add-In to close the Start Page in Visual Studio after you open your project


This is a simple Visual Studio add-in that will automatically close the Start page when you open your solution in Visual Studio.

I love Visual Studio and the Start Page but why there isn't an option to close the Start Page after you open your solution is beyond me. And if you ever need to re-open the Start Page, simply go to the "View" menu and select "Other Windows" and click "Start Page".

Using the Code

To build this application from scratch go into Visual Studio and select "New" Project. Then browse to "Other Project Types\Extensibility" and select "Visual Studio Add-in". Then name your project "StartPageCloser".

Next the Add-in Wizard will start and for this project, we will select C# code:

Next, only select Microsoft Visual Studio:

Give a good description of your Add-in:

Set your Add-in to load on Startup:

The About dialog box is optional. Then Click finish to start your new Add-in project.

Here is where you will need to add your code. Start by adding the private variables needed to capture the Open Solution event.  You can add this code at the top or the bottom of the Connect class. You should already be in the Connect class, if not then open the Connect.cs file.

// Private variables used to capture the Solution events
private Events2 events;
private SolutionEvents solutionEvents;

Next go to the "OnConnection" event function and add the following code after the line:
_addInInstance = (AddIn)addInInst;

// Capture our Events
events = (Events2)_applicationObject.Events;
solutionEvents = events.SolutionEvents;

// Capture our Solution Opened Event
solutionEvents.Opened +=
new _dispSolutionEvents_OpenedEventHandler(SolutionEvents_Opened);

Finally all you need to do is add your SolutionEvents_Opened function.

/// <summary>
/// Our Solution has been opened
/// </summary>
private void SolutionEvents_Opened()
	// Find the Start Page and Close it
	if (_applicationObject.Windows.Item
		(EnvDTE80.WindowKinds.vsWindowKindKindStartPage) != null)
		// Close the Start Page

You are now ready to compile and use your new Add-in.  After you compile, the Add-in will be added to your Visual Studio Addins folder.  This will point to the location of your Add-in DLL.  Feel free to change your project to "Release" mode when you are done.

Points of Interest

Sometimes, in order to compile your add-in you will need to close Visual Studio and make sure that it is not set to load your add-in on Startup by going to the "Tools" menu and "Add-in Manager..." and un-checking "Startup" for your add-in. Then close and re-open Visual Studio and open your project. Now you will be able to compile. Just remember to go back in and re-check "Startup" when you are done.


  • 26th March, 2009: Initial post 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Technical Lead ABILITY Network Inc
United States United States
Began writing software at the age of 10.
Graduated from the University of Houston in 1995 with a BS in Computer Science and a minor in Math.
I love developing great software and websites.
I recently moved to Seattle and I'm currently working for a Health Care Analytics company.

Hobbies include Basketball and Soccer and very happily married to a wonderful wife.

You may also be interested in...


Comments and Discussions

GeneralMy Vote of 4 Pin
pvandijk2831-Mar-09 21:00
memberpvandijk2831-Mar-09 21:00 
GeneralRe: My Vote of 4 Pin
EricFaust1-Apr-09 5:38
memberEricFaust1-Apr-09 5:38 
GeneralMy vote of 2 Pin
Avi_Harush30-Mar-09 21:21
memberAvi_Harush30-Mar-09 21:21 
GeneralRe: My vote of 2 Pin
Member 192044118-Apr-09 2:55
memberMember 192044118-Apr-09 2:55 
GeneralRe: My vote of 2 Pin
EricFaust24-Apr-09 11:50
memberEricFaust24-Apr-09 11:50 
GeneralMy vote of 1 Pin
Priyank Bolia28-Mar-09 18:39
memberPriyank Bolia28-Mar-09 18:39 
GeneralRe: My vote of 1 Pin
EricFaust30-Mar-09 3:33
memberEricFaust30-Mar-09 3:33 
NewsOr you could just check the options dialog... Pin
Member 300191026-Mar-09 13:41
memberMember 300191026-Mar-09 13:41 
GeneralRe: Or you could just check the options dialog... Pin
Michael.F.Starke26-Mar-09 16:13
memberMichael.F.Starke26-Mar-09 16:13 
GeneralRe: Or you could just check the options dialog... Pin
EricFaust26-Mar-09 16:38
memberEricFaust26-Mar-09 16:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180321.1 | Last Updated 26 Mar 2009
Article Copyright 2009 by EricFaust
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid