Are Task Panes Available in Visio VSTO?
I need create a dockable window for my Visio 2010 add-in developed with VSTO, however I see no way of creating a task开发者_开发技巧 pane for Visio.
Am I missing something?
Unfortunately, neither Visio 2007 nor Visio 2010 supports Custom Task Panes.
http://msdn.microsoft.com/en-us/library/aa942846%28v=vs.80%29.aspx#Y649
You create dockable windows in Visio. These are "anchor" windows.
See this MSDN page: http://msdn.microsoft.com/en-us/library/ff767674.aspx
For example: some years ago I created an anchor window to simulate the Office ribbon UI which was not available in Visio 2007 at the time: http://blogs.msdn.com/b/saveenr/archive/2007/02/27/adding-a-ribbon-to-visio.aspx
You can add a custom task pane to an application for Visio by following these steps:
- Open or create an application-level project for an application.
- On the Project menu, click Add User Control.
- In the Add New Item dialog box, change the name of the new user control to MyUserControl, and click Add.
- The user control opens in the designer.
- Drag one or more Windows Forms controls from the Toolbox to the user control.
- Open the ThisAddIn.cs or ThisAddIn.vb code file. (For C#) Private MyUserControl myUserControl1;
- Add the following code to the ThisAddIn class. This code declares an instance of MyUserControl as a member of ThisAddIn. (For C#) myUserControl1 = new MyUserControl(); Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane = this.CustomTaskPanes.Add(myUserControl1, ""My Task Pane""); myCustomTaskPane.Visible = true;
Source: msdn.microsoft.com/en-us/library/aa942846%28v=vs.80%29.aspx#Y649
精彩评论