Collapse & unhighlight menu items

Aug 6, 2010 at 5:40 AM

If I open a childWindow from a menu item click event handler, the menu drop down stays open and the menu item stays highlighted.  I can programmatically collapse the drop down menu, but the menu item stays highlighted until the next time I open its drop down menu.  Anyone know how to unhighlight the menu item?

Aug 6, 2010 at 2:43 PM

Ok- I found an easy fix for this.  I just rebuilt the control making this event public instead of private:


public void ItemHighlight_MouseLeave(object sender, MouseEventArgs e) { ... }

and then in my click handler, after I open the childWindow I execute:

(sender as MenuItem).ItemHighlight_MouseLeave(null, null);
(sender as MenuItem).parentMenuBarItem.CollapseDropDown();

And it's fixed!