Are Task Panes Available in Visio VSTO?

雨燕双飞 提交于 2020-01-06 15:21:53

问题


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?


回答1:


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




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/5246213/are-task-panes-available-in-visio-vsto

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