Language: Pascal Expertise: Beginner
Feb 19, 1999
Determining Shift Button State
Question :
How can I determine if
is down or up while dragging an object within my app? The goal is to detect if something is being copied or moved.Answer : In the MouseDown event handler of a control, you'll see that the event handler is declared as follows:
procedure TForm1.SpeedButton2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
end;
The Shift argument will tell you what shift button is pressed (Shift, Ctrl, or Alt). You can use it to detect the Shift state. For more details, look in the online help.
DevX Pro
Please enable Javascript in your browser, before you post the comment! Now Javascript is disabled.