mousedown event 
Author Message
 mousedown event

Hello,

Could anybody tell me if it is possible to capture a mousedown event from
anywhere on a userform. In essence what i am trying to do is get a popup
menu to popup if a user rightclicks anywhere on the userform even over
other controls.

TIA

geoffc



Mon, 14 Jan 2002 03:00:00 GMT  
 mousedown event
Geoff,

I think that you are going to need to have code assigned to each control on
that form to capture the mousedown event when you click on a part of the
form occupied by a control.  For instance, here is the code for the form:

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
    If Button = 1 Then
        MsgBox "You clicked the left button"
    ElseIf Button = 2 Then
        MsgBox "You clicked the right button"
    End If
End Sub

But as you probably already know, this event does not get fired if you click
in the region of a control on that form.

Maybe Stephen (or someone) has a really cool trick that can do what you
want.

--
Jennifer A. Campion
MCSD, MCSE, MCT, MVP


Quote:

> Hello,

> Could anybody tell me if it is possible to capture a mousedown event from
> anywhere on a userform. In essence what i am trying to do is get a popup
> menu to popup if a user rightclicks anywhere on the userform even over
> other controls.

> TIA

> geoffc



Mon, 14 Jan 2002 03:00:00 GMT  
 mousedown event
Jennifer,

I guessed I would have to assign code to each control and ordinarily that
is what I would have done. However one of the controls on my form is a
calender control which does not seem to support the mousedown event. Do you
have any ideas about this?
thanks,

geoffc



Quote:
> Geoff,

> I think that you are going to need to have code assigned to each control
on
> that form to capture the mousedown event when you click on a part of the
> form occupied by a control.  For instance, here is the code for the form:

> Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As
> Integer, ByVal X As Single, ByVal Y As Single)
>     If Button = 1 Then
>         MsgBox "You clicked the left button"
>     ElseIf Button = 2 Then
>         MsgBox "You clicked the right button"
>     End If
> End Sub

> But as you probably already know, this event does not get fired if you
click
> in the region of a control on that form.

> Maybe Stephen (or someone) has a really cool trick that can do what you
> want.

> --
> Jennifer A. Campion
> MCSD, MCSE, MCT, MVP



Mon, 14 Jan 2002 03:00:00 GMT  
 mousedown event
Haven't tried it, but maybe you could put something on top of it that is
transparant that would respond to the mousedown.   If I get a moment, I will
see if I can come up with anything.

Good luck,

Jennifer


Quote:
> Jennifer,

> I guessed I would have to assign code to each control and ordinarily that
> is what I would have done. However one of the controls on my form is a
> calender control which does not seem to support the mousedown event. Do
you
> have any ideas about this?
> thanks,

> geoffc



> > Geoff,

> > I think that you are going to need to have code assigned to each control
> on
> > that form to capture the mousedown event when you click on a part of the
> > form occupied by a control.  For instance, here is the code for the
form:

> > Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As
> > Integer, ByVal X As Single, ByVal Y As Single)
> >     If Button = 1 Then
> >         MsgBox "You clicked the left button"
> >     ElseIf Button = 2 Then
> >         MsgBox "You clicked the right button"
> >     End If
> > End Sub

> > But as you probably already know, this event does not get fired if you
> click
> > in the region of a control on that form.

> > Maybe Stephen (or someone) has a really cool trick that can do what you
> > want.

> > --
> > Jennifer A. Campion
> > MCSD, MCSE, MCT, MVP



Mon, 14 Jan 2002 03:00:00 GMT  
 mousedown event
No, no, that's not going to work. What was I thinking?  Let me have some
more coffee and see if I can get my brain to actually function.

Jen



Mon, 14 Jan 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. mousedown event

2. mousedown event on a worksheet?

3. Open a popup from a modal form in Mousedown event

4. test for continuous mousedown event?

5. TreeView MouseDown Event

6. MouseUp/MouseDown Events

7. MouseDown client coordinate system Office 97

8. Protected Chart MouseDown ??

9. Chart.MouseDown X Y vary when Sheet Scrolled

10. ACC2000: ListBox MouseDown bug?


 
Powered by phpBB® Forum Software © phpBB Group