Main Menu

Dockable Window

Started by Thomas Winkel, November 12, 2012, 05:12:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thomas Winkel

Hi,

in order to separate Code and Documents I am planning to convert my VBA project to .NET (C#).
First I would like to start with the GUI (also to have a mock-up for presentations soon).
The functionality will be converted step by step.

There is one form which should dock to the bottom of the Visio Window instead of open in a separate window.
I tried lot of things with code from the internet, but only had crashes.

Could someone help me to start "frmExports" in a docked window, please?

Regards,
Thomas




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;

namespace Test
{
    public partial class RibbondSPACE
    {
        private void RibbondSPACE_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void buttonExports_Click(object sender, RibbonControlEventArgs e)
        {
            frmExports form = new frmExports();
            form.Show();
        }
    }
}

Thomas Winkel

Ok, done.

In the Visio SDK is an example code "Anchor Bars Usage".
To make this work for my code I just had to:
1. slightly adapt (and rename) the class "AnchorBarsUsage"
2. add the method "ParentVisioApplication" to "frmExports".

This is the only modification in my original code from above:

private void buttonExports_Click(object sender, RibbonControlEventArgs e)
        {
            anchorBarExports anchorBarForm = new anchorBarExports();
            anchorBarForm.Show(Globals.ThisAddIn.Application, true);
        }


I don't understand what I'm doing, but it works  8)

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 145 (show)
Files included: 32 - 1218KB. (show)
Memory used: 1041KB.
Tokens: post-login.
Cache hits: 13: 0.00190s for 26,582 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]