Solved Command button with both single click event and ctrl click event. (1 Viewer)

Mike Krailo

Well-known member
Local time
Today, 03:51
Joined
Mar 28, 2020
Messages
1,030
Just wondering if it is possible to both single click on a command button to trigger a normal event and launch different code using ctrl-click on the same button? I also tried both single and double click events on the same button and the single click event seems to override the double click event. Then I thought that it would be nice to modify the event code using Ctrl-Click which would be desirable. Right now the form in question has a simple check box which must be set or unset to achieve the desired results using standard logic in the on click event.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 03:51
Joined
May 21, 2018
Messages
8,463
What about?

Code:
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  If Shift = 1 Then
    MsgBox "Do something for shift"
  Else
    MsgBox "do somethig for No Shift"
  End If
End Sub
 

Mike Krailo

Well-known member
Local time
Today, 03:51
Joined
Mar 28, 2020
Messages
1,030
Works perfectly.
 

Users who are viewing this thread

Top Bottom