How do I extend the project properties screen in Visual Studio?

后端 未结 1 1005
盖世英雄少女心
盖世英雄少女心 2021-01-01 00:08

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

相关标签:
1条回答
  • 2021-01-01 00:30

    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)]
    
    0 讨论(0)
提交回复
热议问题