mobigital

I don't see Panel in the toolbox when customizing a host document (Excle Sheet).

Is there a way to add my own panel and/or a User Control to the host document If I can add listboxes, textboxes, buttons, etc. why not allow to add a Panel as well.



Re: Visual Studio Tools for Office Adding Panel or UserControl to document host item

Cindy Meister

Have you tried creating a Usercontrol in the VSTO document project, then dragging it onto a worksheet It works for me...




Re: Visual Studio Tools for Office Adding Panel or UserControl to document host item

mobigital

I tried,
When I drag it onto the document, it pastes the .cs file's path and name into the spreadsheet.





Re: Visual Studio Tools for Office Adding Panel or UserControl to document host item

McLean Schofield - MSFT

It sounds like you're dragging the UserControl.cs file (or whatever it is named for your project) from Solution Explorer onto the worksheet surface. When I try that, I also get the .cs file's path and name added to the worksheet.

What you want to do instead is to drag the user control from the Toolbox onto your worksheet. When you add a user control to your project and then build your project, a draggable user control component is added to the Toolbox, under the section "<Your solution name> Components". By dragging this component onto your worksheet, you will get the user control

I hope this helps,

McLean Schofield






Re: Visual Studio Tools for Office Adding Panel or UserControl to document host item

mobigital

great, that works.

another question - the control's background color is frequently set to "Control" but it inherits the color from parent. When I change it to another value and back to "Control" it becomes gray (actual control color).

How do I set that color back to "parent's" background color






Re: Visual Studio Tools for Office Adding Panel or UserControl to document host item

mobigital


VS has created an additional class over my user control class that inherits from user control class. what is the best way to get that re-generated - other than deleting it from sheet designer and adding back again