Use the following code in your Ribbon OnAction method to display a WPF User control in an office task pane:
Dim pane As WPFUserControlName= Nothing
If pane Is Nothing Then
Dim uControl As New UserControl()
Dim host As ElementHost = New ElementHost()
pane = New WPFUserControlName()
host.Child = pane
host.Dock = DockStyle.Left
host.Width = 200
uControl.Controls.Add(host)
taskPane = Globals.ThisAddIn.CustomTaskPanes.Add(uControl, "Biographies")
taskPane.Visible = True
Else
taskPane.Visible = True
End If
No comments:
Post a Comment