Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

VSTO: How to add a button to a custom task pane

$
0
0

Can someone help me with the code for programmatically adding a GroupBox and Buttons to a custom task pane in MS Project 2010?  

I am  creating a MS Project 2010 VSTO Addin and have already created a custom task pane.  I just can't seem to figure out how to add a GroupBox or buttons to it?  Below is the code I have so far.

Public Class ThisAddIn

Private myFieldNavControl As System.Windows.Forms.UserControl Private myFieldNavTaskPane As Microsoft.Office.Tools.CustomTaskPane Public Shared myFieldNavTaskPaneCollection As Microsoft.Office.Tools.CustomTaskPaneCollection

Private Sub ThisAddIn_Startup() Handles Me.Startup myFieldNavControl = New System.Windows.Forms.UserControl myFieldNavTaskPaneCollection = Globals.Factory.CreateCustomTaskPaneCollection _ (Nothing, Nothing, "CustomTaskPanes", "CustomTaskPanes", Me) myFieldNavTaskPane = myFieldNavTaskPaneCollection.Add(myFieldNavControl, "Field Nav") With myFieldNavTaskPane .DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionLeft .Width = 105 .Visible = False End With End Sub Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown myFieldNavTaskPaneCollection.Dispose() End Sub End Class

I keep thinking the code should look like this, but of course it doesn't work.

myFieldNavTaskPaneCollection.Item(0).Controls.Add(...)


Wellyn



Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>