How to get a ctrl pressed + click on a label?

Hello guys,

I would like to trigger a function when I click on a label with ctrl key pressed. How to fire the trigger after doing that?

You can give me a simple example with showmessage('pressed!') after clicking on a label with ctrl pressed.

thanks
Alex
LVL 1
hidrauAsked:
Who is Participating?
 
Sinisa VukCommented:
Use OnMouseDown event:
procedure TForm1.Label1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if (ssCtrl in Shift) then
  begin
    showmessage('pressed!');
  end;
end;

Open in new window

1
 
hidrauAuthor Commented:
Thanks a lot my friend for your example
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.