How do I intercept all 'mousedown' events for a form? 
Author Message
 How do I intercept all 'mousedown' events for a form?

I would like to intercept all mousedown events for a form.  Actually, it
would be nice to be able to intercept them for the entire application.  I
need to be able to restart a timer every time there is a mouse-down event.
After processing the event, it needs to be passed on to the originally
intended control.  Can someone give me a code snippet showing how to do
this?  Thanks.

Paul Applegate



Sun, 25 May 2003 03:00:00 GMT  
 How do I intercept all 'mousedown' events for a form?
Have you tried the Form_MouseDown event?


Quote:
> I would like to intercept all mousedown events for a form.  Actually, it
> would be nice to be able to intercept them for the entire application.  I
> need to be able to restart a timer every time there is a mouse-down event.
> After processing the event, it needs to be passed on to the originally
> intended control.  Can someone give me a code snippet showing how to do
> this?  Thanks.

> Paul Applegate



Sun, 25 May 2003 03:00:00 GMT  
 How do I intercept all 'mousedown' events for a form?
Sorry, Form_MouseDown just gets fired if no other control takes the hit. It
does not worrk like KeyPreview.


Quote:
> I would like to intercept all mousedown events for a form.  Actually, it
> would be nice to be able to intercept them for the entire application.  I
> need to be able to restart a timer every time there is a mouse-down event.
> After processing the event, it needs to be passed on to the originally
> intended control.  Can someone give me a code snippet showing how to do
> this?  Thanks.

> Paul Applegate



Sun, 25 May 2003 03:00:00 GMT  
 How do I intercept all 'mousedown' events for a form?
If you use arrays of controls, you have a mousedown event for each array.
Then you only need to repeat your code a few times.
E.g:
Private Sub Command_Buttons_MouseDown(Index As Integer, Button As Integer,
Shift As Integer, X As Single, Y As Single)
    Code for all buttons - i.e. your interception event
    select case index
        code for individual buttons
    end select
End Sub

Same for
Private Sub Labels_MouseDown(Index As Integer, Button As Integer, Shift As
Integer, X As Single, Y As Single)
Private Sub Text_Boxes_MouseDown(Index As Integer, Button As Integer, Shift
As Integer, X As Single, Y As Single)
etc.

And of course Form_MouseDown



Quote:
> I would like to intercept all mousedown events for a form.  Actually, it
> would be nice to be able to intercept them for the entire application.  I
> need to be able to restart a timer every time there is a mouse-down event.
> After processing the event, it needs to be passed on to the originally
> intended control.  Can someone give me a code snippet showing how to do
> this?  Thanks.

> Paul Applegate



Mon, 26 May 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Why won't the mousedown event fire?

2. MouseDown event - Shift value doesn't change

3. How to intercept the scrollbar's event of a textbox control

4. How to intercept the scrollbar's event for a textbox control

5. MCI control doesn't generate DONE Event

6. VB4/Win95-HELP: MMcontrol.OCX doesn't issue a DONE event after playing AVI

7. intercept and modify 'Insert Caption'

8. ADO thinks DBMS is done, but DBMS ain't done

9. How to tell when all a form and all it's elements are done loading

10. Unloading or hiding a form in the form's load event

11. Intercepting Close event through AutoClose macro ( also intercepting FilePrint and FileSave)

12. changing a picture's source upon mouseOver / mousedown / whatever :)

 

 
Powered by phpBB® Forum Software