根据你的描述,我认为你可以使用自定义的toolwindow来实现它。有关更多信息,请参见: https://msdn.microsoft.com/en-us/library/cc138567.aspx
从Visual Studio 2010中,工具窗口本身是基于WPF技术的开始,虽然他们仍然提供的WinForms组件的托管向后兼容性。
如果您使用Winform控件,请参考以下代码。
namespace TWToolbar
{
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
using System.ComponentModel.Design;
using System.Collections.Generic;
/// <summary>
/// This class implements the tool window exposed by this package and hosts a user control.
/// </summary>
/// <remarks>
/// In Visual Studio tool windows are composed of a frame (implemented by the shell) and a pane,
/// usually implemented by the package implementer.
/// <para>
/// This class derives from the ToolWindowPane class provided from the MPF in order to use its
/// implementation of the IVsUIElementPane interface.
/// </para>
/// </remarks>
[Guid("1a24c96c-30bd-466b-8315-14bf54e4f17a")]
public class TestToolWindow : ToolWindowPane
{
/// <summary>
/// Initializes a new instance of the <see cref="TestToolWindow"/> class.
/// </summary>
///
public UserControl1 control;
public TestToolWindow() : base(null)
{
this.Caption = "TestToolWindow";
// This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
// we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
// the object returned by the Content property.
this.control = new UserControl1();//new TestToolWindowControl(users);
}
override public System.Windows.Forms.IWin32Window Window
{
get
{
return (System.Windows.Forms.IWin32Window)control;
}
}
}
}
示例项目:https://1drv.ms/u/s!AlvaNEnglADDgRMFqXKjdb63OeeK
所以,我说的对,使用工具/外部工具是不适合你的选择,正确吗?它应该集成到VS. – Fildor
只需通过Google搜索,我发现:https://msdn.microsoft.com/de-de/library/dd885119(v=vs.110).aspx,https://msdn.microsoft.com/en-us/library/ bb166030.aspx,只是为了命名顶级命中。 – Fildor
是的,它只需要在VS中集成,但不能作为工具/外部工具选项。我需要使用插件/扩展来打开我的winform应用程序,用户不需要指定应用程序打开的路径。 – Gerry