How to add custom panel to Visio 2013 add-in?

I recently wrote an add-in add-in that has a ribbon.xml file for an extra feed, context menu, etc. I also added an extra panel attached to the right of my window.

Now I started some research on how to create add-ins for Visio. Ribbon.xml is almost the same, so this is not a problem at all. However, I cannot find a way to add a custom panel when opening a Visio document.

So far I have in Visio to find out if a document is open / created / edited:

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    MessageBox.Show("Visio Add-In V1");
    Globals.ThisAddIn.Application.DocumentChanged += new Visio.EApplication_DocumentChangedEventHandler(docChanged);
    Globals.ThisAddIn.Application.DocumentOpened += new Visio.EApplication_DocumentOpenedEventHandler(docChanged);
    Globals.ThisAddIn.Application.DocumentCreated += new Visio.EApplication_DocumentCreatedEventHandler(docChanged);
}

private void docChanged(Visio.Document doc)
{
    MessageBox.Show("Document loaded");
}

In Outlook, I would do this to add a custom panel (simplified):

MyPanel ctrl = new MyPanel();
Microsoft.Office.Tools.CustomTaskPane ctp = Globals.ThisAddIn.CustomTaskPanes.Add(ctrl, title);
ctp.Visible = true;
ctp.Width = 300;
ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight;

Now, how can I do this in the Visio 2013 add-in?

Edit:

, , : http://msdn.microsoft.com/en-us/library/vstudio/bf08984t.aspx

Edit2:

: Visio VSTO?

. :

Globals.ThisAddIn.Application.Windows.Add("testpanel", VisWindowStates.visWSDockedLeft, VisWinTypes.visStencilAddon, null, null, null, 300);

, ...

Edit3:

Visio COM , .

Application.Windows.Add("testpanel", VisWindowStates.visWSDockedRight, VisWinTypes.visAnchorBarAddon, null, null, 300);
+5
1

Visio, SDK Visio , " " .

MSDN Windows.Add Method (Visio) - http://msdn.microsoft.com/en-us/library/office/ff767674.aspx

+2

All Articles