Visual Studio 2010:在VSPackage工具窗口中使用Winforms用户控件

| 使用工具窗口创建简单的VSPackage时,将创建示例WPF用户控件并将其添加到工具窗口。 此用户控件必须是WPF吗?我有一个winforms用户控件,将其添加到工具窗口时不会显示。尝试将其托管在WPF中没有成功。有什么标准的方法吗?     
已邀请:
我遇到了同样的问题。搜索了很多。无法找到答案或样本。终于在msdn论坛上发布了。得到了我的答案。这是msdn论坛主题线程的链接 MSDN论坛主题链接 ToolWindowPane可用于承载WPF内容或Winform控件。 对于Winform控件,您只需要重写Window属性get,并将Content属性保留为空。 例如:
public MyToolWindow() :  base(null)
    {
        this.Caption = Resources.ToolWindowTitle;
        this.BitmapResourceID = 301;
        this.BitmapIndex = 1;
        control = new MyControl();
    }

     override public System.Windows.Forms.IWin32Window Window
    {
        get
        {
            return (System.Windows.Forms.IWin32Window)control;
        }
    }
    
我几乎可以肯定它也可以是winforms,并且我确定MSDN上有一个演示。我看是否可以在某个时候进行挖掘。     

要回复问题请先登录注册