mouse down and mouse up event

On a webpage I have, I want the webpage itself to handle certain mouse down and mouse up events, but I also want the underlying control to handle the event. This works fine for certain controls, such as the button control or the text control. But for the listbox control and the segmentedbutton control, handling mouse events at the webpage level seems to prevent the control from working properly. The segmentedcontrol looks like it is getting the event, but the selected button doesn’t change. For the listbox, I can’t select any item in the list.

Is there a way to use a page level event handler for the mouse up and mouse down events, but still reliably have the underlying control handle the event as well?

Kevin Clark

Do you have the [quote]Return true[/quote] statement in your mousedown event? Without this the mouse up will never fire

Events in a web app don’t have a return value. And the event is called KeyPressed.

I wasn’t able to tame this very same problem.

What is wrong with using the controls events, in addition to the page ones ? If you want to handle them all in one place, just use a common method you call from each…

For example because WebListbox.KeyPressed doesn’t fire.

The OP mentioned MouseDown and MouseUp.

For KeyPressed, JavaScript Document.KeyDown will catch the event on all the page. But from what I see here, neither ListBox not segmented control seem to steal the page event.