djangojazz
djangojazz

Reputation: 13242

Can a VSTO add in for MS Project show a UI besides the Ribbon?

TLDR; Can you give more real estate in VSTO to MS Project Desktop Add in then a little Ribbon control?

I was working for the first time with a VSTO add in and the tutorials I think are older which I expect, but even so I am not finding any help for the UI portion really: https://learn.microsoft.com/en-us/visualstudio/vsto/walkthrough-creating-your-first-vsto-add-in-for-project?view=vs-2022&tabs=csharp

I was able to put in a new item in my project and it shows fine

Ribbon (Visual Designer)

Is it possible to a larger area pane to show with VSTO? I was looking at the tutorial and it just basically inserts a task and mentions nothing on the UI but the ribbon. Is this all there is you can do graphically? I just really wanted to give more real estate and do some dropdowns and buttons to call a service I made. I can do that but it looks very small:

enter image description here

Is there any way to at least give more real estate? This is for a Project Professional Office 365 Desktop? I have created a whole WPF User control and I thought I read you can wire that up but it never shows. Do you have to do something with the

ThisAddIn.cs

enter image description here

I feel like I have read a lot of data, but have not found a simple tutorial on the UI portion of what Project can do. I can do the Ribbon but I thought I read somewhere that the Add Ins can take a WPF or Winforms UserControl. I just don't know how to wire it up.

As always, any help is much appreciated.

Upvotes: 0

Views: 61

Answers (2)

djangojazz
djangojazz

Reputation: 13242

You cannot have it load up a WPF User Control UNLESS that is nested in Windows Form. My WPF was working fine but there is no way without a parent body to host it. There is no Main Windows WPF form for Project or any other main body element that I could see as all the other Add Ins for Word, Outlook, Excel etc have better eventing for UIs.

So you add a Windows Form, there isn't one by default. You set the 'child' in the Properties pane of this form to be a user control in WPF for more modern design abilities of WPF. Then you need a trigger like a button as you still need to use the ribbon unless you want to do something simple and use the startup, but then you cannot get it back. Then it's similar to

var form = new Form1();
form.Show();

But you need to have know how to apply the Ribbon, make a Windows Form, set a control inside that.

Upvotes: 0

Related Questions