Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu (Mis)Behaviour?

Status
Not open for further replies.

MichaelRed

Programmer
Dec 22, 1999
8,410
US
On one of my menu items, I have sub-menus. In the Menu Item, I inadvertantly placed some code. I know this is wrong, but when I select the Parent Menu and place the mouse pointer on the menu item, it apparently fires the click event of the item, thus obscuring the submenus. I know that if I CLICK on the item, the (Click) code should activate, but WHY does it activate BEFORE there is any event (except - perhaps - the mouse move)?

I "half-way" understand it, as when you place the mouse over a menu item with sub-menu items, it shows the sub menus. On the other hand, there is no apparent code in the form to show this.

Does anyone know where this 'activity' is documented? Or cay someone explain the mechanisim which causes this?



MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
I think what Microsoft did is they wanted the child menus to auto-appear after a slight delay when the user hovers over them. But they also wanted power users to be able to click their way through without having to wait for the delay. So, to accomodate each behavior, when a menu is shown that has child items, a timer is started. When the timer expires, they have it fire the click event of the menu you're hovering over to cause the child menu to appear.

It's a cool feature, but like many innovations, it sometimes gets in the way...

Like you discovered, you just don't put any code in the click event of the menu items that have children.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top