How to pass a variable to a custom task pane in VB.Net

255 views Asked by At

I know you can pass a variable to a form by adding a property to the form class. Can the same be done for a custom task pane? It doesn't look like you can add a public property to a custom task pane.

Edit:

To clarify, I have two Windows forms and they both have buttons that when clicked will load the custom task pane. In the custom task pane I need to be able to use text that have been entered into text boxes in the forms. But the custom task pane will not know which of the two forms' button was clicked, so in the click events of the buttons I would like to be able to pass a variable to the custom task pane to tell it which form called it.

1

There are 1 answers

0
Eugene Astafiev On

It is not clear where you need to pass a variable. But you can use the following properties to access your add-in properties from a task pane:

Globals.ThisAddIn

Also you can call public properties of your task pane locating an instance in the CustomTaskPanes collection (see the corresponding property of the add-in class).