Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I right click in a TextBox, it generates two mousedown events. Is this
normal, or do I have a problem? Code below illustrates the "problem". thanks for any insight!! Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Static i As Integer i = i + 1 Debug.Print i End Sub Immediate Window: 1 2 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike,
I can confirm that behaviour in XL+Word 2000 and also in XL2002. Can't find an explanation anywhere at the moment, but may be something to do with the menu item that can appear to cut/copy etc the text in a TextBox. e.g. ListBox (not editable) does not show this behaviour, but a comboBox (editable) does. You could test for the right button, or more correctly the non-primary button. Something like this: Dim ProcessClick As Boolean Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If Button < xlPrimaryButton Then ProcessClick = Not ProcessClick If ProcessClick = False Then Exit Sub End If End If 'Your code End Sub NickHK "Mike" wrote in message ... When I right click in a TextBox, it generates two mousedown events. Is this normal, or do I have a problem? Code below illustrates the "problem". thanks for any insight!! Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Static i As Integer i = i + 1 Debug.Print i End Sub Immediate Window: 1 2 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike,
Yes, this problem is known for a long time. Static Click As Integer Click = Click + 1 If Not Click Mod 2 = 0 Then Exit Sub ' Your code MP "Mike" a écrit dans le message de news: ... When I right click in a TextBox, it generates two mousedown events. Is this normal, or do I have a problem? Code below illustrates the "problem". thanks for any insight!! Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Static i As Integer i = i + 1 Debug.Print i End Sub Immediate Window: 1 2 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Click Events on a MultiPage | Excel Programming | |||
Two double click events? | Excel Programming | |||
simulating click events | Excel Programming | |||
Click events on charts | Excel Programming | |||
trapping click events on shapes | Excel Programming |