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

Deadly 提交于 2019-12-03 07:36:20

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)]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!