Accessing Controll inside of an Adv.Taskpane

Add-in Express™ Support Service
That's what is more important than anything else

Accessing Controll inside of an Adv.Taskpane
 
Ma ka




Posts: 75
Joined: 2011-02-25
Dear Eugen,

i have some Adv. Taskpanes in my Project and inside of two of them i have controlls witch are depend from each other.

How can i connect to an Object witch is running inside of an other Adv.Taskspane

Thanks Ma Ka
Posted 28 Mar, 2011 03:59:19 Top
Fedor Shihantsov


Add-in Express team


Posts: 1188
Joined: 2005-01-11
Hello Ma Ka,

You can use the following properties and collections:

Excel:
AddinExpress.XL.ADXExcelTaskPane etp1 = adxExcelTaskPanesCollectionItem1.TaskPaneInstance;

Word:
AddinExpress.WD.ADXWordTaskPane wtp1 = adxWordTaskPanesCollectionItem1.CurrentTaskPaneInstance;
AddinExpress.WD.ADXWordTaskPane wtp2 = adxWordTaskPanesCollectionItem1.TaskPaneInstances[i];

PowerPoint:
AddinExpress.PP.ADXPowerPointTaskPane pptp1 = adxPowerPointTaskPanesCollectionItem1.TaskPaneInstances[i];
AddinExpress.PP.ADXPowerPointTaskPane pptp2 = adxPowerPointTaskPanesCollectionItem1.TaskPaneInstance;

The following TaskPane properties let you get TaskPanesManagers:

this.ExcelTaskPanesManager;
this.WordTaskPanesManager;
this.PowerPointTaskPanesManager;

Also you can use an AddinModule instance from TaskPane in the following way:
MyAddin1.AddinModule.CurrentInstance as MyAddin1.AddinModule

If you have other questions, don't hesitate to let me know.
Posted 28 Mar, 2011 06:22:43 Top
Ma ka




Posts: 75
Joined: 2011-02-25
Dear Fedor,

it works not with vb.net ....

Thanks Ma Ka
Posted 28 Mar, 2011 07:17:02 Top
Fedor Shihantsov


Add-in Express team


Posts: 1188
Joined: 2005-01-11
The same methods and properties are available in VB.NET.

What particular problem do you have?
Posted 28 Mar, 2011 07:27:31 Top
Ma ka




Posts: 75
Joined: 2011-02-25
The Code:
"AddinExpress.XL.ADXExcelTaskPane etp1 = adxExcelTaskPanesCollectionItem1.TaskPaneInstance;"

Brings:

"ADXExcelTaskPane"is a type in "XL"and can not be used as an expression.
The name "ETP1" was not declared.
Method arguments must be enclosed in parentheses.
Name adxExcelTaskPanesCollectionItem1 "was not declared.


Thanks Ma Ka
Posted 28 Mar, 2011 07:37:27 Top
Fedor Shihantsov


Add-in Express team


Posts: 1188
Joined: 2005-01-11
Please see the VB code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim secondTaskPane As ADXExcelTaskPane2 = TryCast(CType(MyAddin5.AddinModule.CurrentInstance, MyAddin5.AddinModule).AdxExcelTaskPanesCollectionItem2.TaskPaneInstance, ADXExcelTaskPane2)
        secondTaskPane.TextBox1.Text = "Test"
    End Sub


You can download the sample with this code.

Please see the How to switch between several Advanced Excel Task Panes programmatically howto.

The following tool can help you in the future: Convert VB.NET to C# ,
Convert C# to VB.NET
Posted 28 Mar, 2011 09:23:46 Top
Ma ka




Posts: 75
Joined: 2011-02-25
Dear Fedor,

that fix my issues.

Thanks Ma Ka
Posted 28 Mar, 2011 12:16:03 Top