I found a work around to this by using Rick Brewster's suggestions.
First, I modified Rick's class by adding a constructor public ToolStripEx() : base() { }
public ToolStripEx() : base() { }
Then in my dockable window's designer class "MyClass.Designer.cs" I changed the toolstrip's declared type from System.Windows.Forms.ToolStrip to ToolStripEx.
System.Windows.Forms.ToolStrip
ToolStripEx
Next, in the InitializeComponent() method of the same designer class, I changed the initialization type for the toolstrip the same way from this.MyToolStrip = new System.Windows.Forms.ToolStrip() to this.MyToolStrip = new ToolStripEx().
InitializeComponent()
this.MyToolStrip = new System.Windows.Forms.ToolStrip()
this.MyToolStrip = new ToolStripEx()
Finally, I set this.MyToolStrip.ClickThrough = true; in the default property assignment section in the same designer class.
this.MyToolStrip.ClickThrough = true;
Now the buttons on the toolstrip fire the onClick event everytime - even when the dockable window is not active!
Hi Tim! Thank you very much for letting me know. It's awesome to read that there actually is a solution. I will check if we still have that problem at the customer's side and implement it that way, if possible.
Maybe you want to copy&paste your solution into GeoNet too, for future reference for other people having the same issue?
Andry Joos - I was having the same issue but was able to find a solution. I documented it on GIS Stack Exchange here.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.