开发者

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:

  1. Open or create an application-level project for an application.
  2. On the Project menu, click Add User Control.
  3. In the Add New Item dialog box, change the name of the new user control to MyUserControl, and click Add.
  4. The user control opens in the designer.
  5. Drag one or more Windows Forms controls from the Toolbox to the user control.
  6. Open the ThisAddIn.cs or ThisAddIn.vb code file. (For C#) Private MyUserControl myUserControl1;
  7. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜