6

When u view a project properties in Visual Studio u get a number of tabs.

The standard ones are "Application", "Build", "Build Events" etc.

It is also possible to add custom tabs. For example view the properties of a WebApplication or a VSIX project you get different (extra) tabs.

So how do I write a VSIX addin that adds a custom tab to the project properties windows?

Simon
  • 33,714
  • 21
  • 133
  • 202

1 Answers1

4

Check out this article: How to: Add and Remove Property Pages.

You create a page like so:

class DeployPropertyPage : Form, Microsoft.VisualStudio.OLE.Interop.IPropertyPage
{
    . . . . 
    //Summary: Return a stucture describing your property page.
    public void GetPageInfo(Microsoft.VisualStudio.OLE.Interop.PROPPAGEINFO[] pPageInfo)
    {
        PROPPAGEINFO info = new PROPPAGEINFO();
        info.cb = (uint)Marshal.SizeOf(typeof(PROPPAGEINFO));
        info.dwHelpContext = 0;
        info.pszDocString = null;
        info.pszHelpFile = null;
        info.pszTitle = "Deployment";  //Assign tab name
        info.SIZE.cx = this.Size.Width;
        info.SIZE.cy = this.Size.Height;
        if (pPageInfo != null && pPageInfo.Length > 0)
            pPageInfo[0] = info;
    }
}

And you register it like so:

[MSVSIP.ProvideObject(typeof(DeployPropertyPage), RegisterUsing = RegistrationMethod.CodeBase)]
sheikhjabootie
  • 7,308
  • 2
  • 35
  • 41
  • I implemented the property page that way, but I don´t get the tabbed view; instead a non-modal dialog shows up (like the general Visual Studio options dialog that has a tree on the left). The tree has a node showing the page´s title... do I miss something? – Matze Dec 27 '13 at 14:46