Adding a form with controls to an add-in window

N

Niklas Deutschmann

Hi,

I'm developing a COM add-in for Visio 2007 using C#, and I would like to add
some controls to a custom Visio.Window:

Visio.Window addInWin = app.Windows.Add("Extrafenster",
Visio.VisWindowStates.visWSAnchorLeft |
Visio.VisWindowStates.visWSAnchorAutoHide |
Visio.VisWindowStates.visWSVisible,
Visio.VisWinTypes.visStencilAddon, 55,
55, 100, 100, null, null, null);

// I created this form using the GUI designer.
frmAddInForm addInForm = new frmAddInForm();

How do I set the form as the content of the Visio window? I have only found
this example for VB and Visio 2000:
http://msdn.microsoft.com/en-us/library/aa140261(office.10).aspx

I have tried the following, without success (remark: I'm a C# and .NET
newbie):

System.IntPtr addInWinHnd = new System.IntPtr(addInWin.WindowHandle);
System.Windows.Forms.Control addInCtrl =
System.Windows.Forms.Control.FromHandle(addInWinHnd);
addInForm.Parent = addInCtrl;

Regards,
Niklas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top