I have recently migrated an Excel macro driven time recording application from Winodws to Mac. I have overcome most of the differences in the vba macro language and Mac subtleties, but am left with one small frustration. On my main userform I have a listbox. In the Windows version I was able to create a mousedown event routine that displayed details of the selected item in a "hidden" textbox by updating the text property and making the textbox visible when the right mouse (button 2) is pressed. I then have a corresponding mouseup event that makes the textbox invisible again when the right mouse button is released. This worked great for years in Windows. However in moving to Mac (Yosemite and Office 365 2016) I have found that the mouseup event is triggered immediately after the mousedown even though the button has not been reelased. This is not so for the left mouse button as I have change the routine to respond to button 1 instead of 2 and it works as expected. However this is not ideal as the textbox flashes whenever an item is selected or double clicked and I want to run another routine on a selection change anyway which uses the same textbox for a different purpose.
i have also removed all my code from both the mousedown and mouseup routines, even removed the mousedown routine completely but every time I press and hold the right mouse button on any item in the listbox the mouseup routine triggers immediately after the mousedown event has executed although I have not released the button or moved the mouse. As I said before, the left mouse works as I'd expect it should and it's always worked in Windows.
The simplest code I have tried is as follows. The doevents statement is to allow me to create a break point for debug purposes.
Private sub Listbox1_mousedown(byval button as long, byval shift as long, byval X, byval Y as long)
If button = 2 then
DoEvents
End if
End sub
Private sub Listbox1_mouseup(byval button as long, byval shift as long, byval X, byval Y as long)
If button =2 then
DoEvents
End if
End sub
In the above example the mouseup event triggers immediately after the mousedown routine finishes executing when pressing and holding the right mouse button.
if I use button = 1 and the left mouse button then the mouseup routine does not trigger.
Is this some sort of passive protest against multi-button mice on an Apple ?
Any ideas would be greatly appreciated.
i have also removed all my code from both the mousedown and mouseup routines, even removed the mousedown routine completely but every time I press and hold the right mouse button on any item in the listbox the mouseup routine triggers immediately after the mousedown event has executed although I have not released the button or moved the mouse. As I said before, the left mouse works as I'd expect it should and it's always worked in Windows.
The simplest code I have tried is as follows. The doevents statement is to allow me to create a break point for debug purposes.
Private sub Listbox1_mousedown(byval button as long, byval shift as long, byval X, byval Y as long)
If button = 2 then
DoEvents
End if
End sub
Private sub Listbox1_mouseup(byval button as long, byval shift as long, byval X, byval Y as long)
If button =2 then
DoEvents
End if
End sub
In the above example the mouseup event triggers immediately after the mousedown routine finishes executing when pressing and holding the right mouse button.
if I use button = 1 and the left mouse button then the mouseup routine does not trigger.
Is this some sort of passive protest against multi-button mice on an Apple ?
Any ideas would be greatly appreciated.