Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
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
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap