Pavel
Guest
|
Hello,
I have added adxtaskpane and placed usercontrol on it. I also placed a adxRibbonDialogBoxLauncher on the custom ribbon.
In the "OnAction" event of it i put code that set Visible property false/ true;
If I start excel with no workbook open ( with /e cmd line arg ), there are no instances of the task pane.
As soon as I open new workbook, new instance of taskpane (and also new instance of its usercontrol ) is created.
I have go through forums here, for example this topic and few other regarding taskpane instances:
https://www.add-in-express.com/forum/read.php?FID=5&TID=8116
However i could not find out how to hide only particular taskpane instance. If i click the laucnher button , all of the taskpane instances are affected (e.g either hidden or shown). When I debug the code i can see the instances property of the taskpane but due the fact its protected it seems i cannot access it.
Q: Is there a way how to access the task pane instances , or at least a way how to hide or show only task pane of the active window ?
BR
Pavel |
|
Andrei Smolin
Add-in Express team
Posts: 18821
Joined: 2006-05-11
|
Hello Pavel,
You should control the visibility of the pane using the ADXBeforeTaskPaneShow event. In the event handler of this event you set this.Visible=false to prevent this pane instance form showing. To hide a given ADXExcelTaskPane instance, get the instance using ADXExcelTaskPanesItem.TaskPaneInstance, and hide it using ADXExcelTaskPane.Hide(). See also a download titled as How to make an Excel task pane visible / invisible programmatically at https://www.add-in-express.com/support/csharp-excel.php#task-panes.
Andrei Smolin
Add-in Express Team Leader |
|
Pavel
Guest
|
Hello Andrei,
Thanks for the example.
But currently I am using the standard task panes (AddinExpress.MSO.ADXTaskPane). Not the advanced one (AddinExpress.XL.ADXExcelTaskPane).
Is there one way to get the instance of the standard task pane ?
BR
Pavel |
|
Andrei Smolin
Add-in Express team
Posts: 18821
Joined: 2006-05-11
|
|
Pavel
Guest
|
Hello Andrei,
Thanks a lot . The problem was that I could not find the Item property since I am using the C# and the example was in VB. I read the document again and I saw the line "in C#, this property is the indexer for the ADXTaskPane class" .
I can get the active instance of the task pane now as
adxTaskPane[ExcelApp.Application.ActiveWindow].
BR
Pavel |
|
Andrei Smolin
Add-in Express team
Posts: 18821
Joined: 2006-05-11
|
Hello Pavel,
Thank you for your feedback. Will consider adding a C# example to that section.
Andrei Smolin
Add-in Express Team Leader |
|