Persistent Drop Down Menu Doesn't Hide

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

Persistent Drop Down Menu Doesn't Hide
 
andrew.helgeland


Guest


I'm developing an Internet Explorer Toolbar using Add-in Express and I've encountered a strange bug that I've occasionally seen in other applications.

I have a ToolStrip on my toolbar that has a few buttons on it. When I click a ToolStripDropDownButton, the drop down displays as expected. Then, if I open a new tab or move the window with the drop down open, the drop down menu doesn't close. It stays right where it was, and active.

I've tried closing all the drop downs on toolStrip_MouseLeave and IEToolbarModule_MouseLeave events, which works, except then the menus are unusable. Entering the drop down menu fires the toolStrip_MouseLeave event, which closes the drop down before I can click on anything.

Any suggestions?

Thank you in advance. :)
Posted 03 Aug, 2012 13:11:02 Top
andrew.helgeland


Guest


I've started a IE Add-on project, added a toolbar, put a dropdown on the toolbar, and added event handlers for most events that would cause the drop down to stay visible.

IEModule events: OnBrowserResized, OnTabActivated, OnTabChanged, OnTabChanging, OnTabClosed, OnTabCreated, OnTabDockChanged

Now each of those events call CloseDropDowns(), which almost solves the problem (as far as I can tell).
The only problem now is moving the window when the drop down is open. It stays right where it was and active. Is there a way to add an "OnBrowserWindowMove" event or something to that extent?
Posted 03 Aug, 2012 13:48:51 Top
Eugene Astafiev


Guest


Hi Andrew,

I couldn't reproduce the issue on my PC with Windows 7 and Internet Explorer 9 installed. So, what IE and Windows version do you have installed on the PC? Could you please provide us with a newly created add-on project which can reproduce the issue? I will test it on my PC. A step-by-step instruction set with screenshots is much appreciated.

Finally, I have just reproduced the issue on my PC with the ToolStrip controls.

Did try to you use the System.Windows.Forms.ComboBox control on the IE toolbar instead? Does it work?

Anyway, please try to use the following code for closing the drop down menu programmatically:

private void MyIEToolbar1_WindowStateChanged(ADXIEWindowState windowState, ADXIEWindowState validState)
{
    toolStripDropDownButton1.HideDropDown();
}


Is it what you are looking for?
Posted 06 Aug, 2012 06:31:51 Top
andrew.helgeland


Guest


I am using Windows 7, IE 9. I can post some screen shots or code, but it sounds like you figured out how to make it happen.

Basically, open a drop down menu, bring the mouse up and out of the button and grab the window . Move the window and the drop down stays.

The WindowStateChanged event doesn't seem to do much.

WindowStateChanged event is raised when: (From MSDN)
The browser window is minimized or restored.
An active tab becomes inactive.
An inactive tab becomes active.
The browser window is enabled or disabled due to a modal dialog box.

Not when the window is moved.
Posted 06 Aug, 2012 09:55:17 Top
Eugene Astafiev


Guest


Hi Andrew,

Yes, I was able to reproduce the issue with the ToolStrip controls. Thank you for the additional info.

Please try to use the OnBrowserResized event of the AddinExpress.IE.ADXIEModule class. Then, from the event handler, you can call a public/internal method of your AddinExpress.IE.ADXIEToolbar class and hide the drop-down list.
Posted 06 Aug, 2012 11:37:43 Top
andrew.helgeland


Guest


I am calling my "CloseAllDropDowns()" method on each of these events:

OnBrowserResized, OnTabActivated, OnTabChanged, OnTabChanging, OnTabClosed, OnTabCreated, OnTabDockChanged, WindowStateChanged

Even with all of that you can still move the window away fr om the drop down. I've seen this kind of problem before, and I think there is an OnFocusKill event somewh ere in WTL. Am I really the first person to bring this to your attention?

Either way, I don't think it is something for Add-In-Express to fix, it's more of a Microsoft problem..

Thanks for trying.
Posted 06 Aug, 2012 14:07:52 Top
Eugene Astafiev


Guest


Hi Andrew,

You are right; the issue doesn't come from the Add-in Express code. I've found a http://www.add-in-express.com/forum/read.php?FID=10&TID=10630 issue on our forum.

Finally, I didn't find any suitable event in IE for closing the drop-down menu from the IE toolbar. Our developers are going to add such an event where you can track changes and close the drop-down list programmatically.
Posted 07 Aug, 2012 04:49:54 Top
andrew.helgeland


Guest


That's wonderful news. How would I find out about ^ when you're done? Also, how would I download and install an update without losing the work that I've done?

Thanks a lot! :)
Posted 07 Aug, 2012 10:26:43 Top
Eugene Astafiev


Guest


Hi Andrew,

You can find the full product history on the http://www.add-in-express.com/news-latest.php page of our web site. Also please follow us on http://twitter.com/addinexpress and subscribe to http://www.add-in-express.com/bitrix/rss.php?ID=19&LANG=en&TYPE=downloads.

There is no need to worry about moving your add-on to the next Add-in Express version/public build. You just need to uninstall the old version and then install a new one.
Posted 07 Aug, 2012 11:46:04 Top