?
Solved

Mouse Down event

Posted on 2009-05-01
8
Medium Priority
?
1,140 Views
Last Modified: 2012-05-06

   hi there,
     
      procedure TForm1.xxxMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
   
     Could you please tell me the difference between TMouseButton and TshifState.

                                 Thanks in advance
0
Comment
Question by:inampudi1
8 Comments
 
LVL 5

Expert Comment

by:xr1140
ID: 24278149
TMouseButton - indicates which button is pressed (left, middle, right)

TShiftState - this set contains the special keys which were pressed (if any) when the mouse button was clicked (Alt, Control, Shift etc).
0
 

Author Comment

by:inampudi1
ID: 24278207
Thank you expert,

  Then Shift in ssRight and Button = mbRight are same.

               Thank you

   
0
 
LVL 13

Expert Comment

by:rfwoolf
ID: 24279289
No

In Microsoft Internet Explorer, if you press Ctrl and left-click on a link, it will open that link in a new window.
ssRight (Right Shift Button) is not the same as mbRight (Right mouse button)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:SteveBay
ID: 24279650
Here is a simple test procedure to demonstrate what is happening in the OnMouseDown Event

Uses TypInfo
 
//
//
procedure TfrmMain.Label1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
     Label1.Caption := GetEnumName(TypeInfo(TMouseButton),  integer(Button)) + ' : ';
     if (ssShift in Shift) then Label1.Caption := Label1.Caption + 'ssShift ';
     if (ssAlt in Shift) then Label1.Caption := Label1.Caption + 'ssAlt ';
     if (ssCtrl in Shift) then Label1.Caption := Label1.Caption + 'ssCtrl ';
     if (ssLeft in Shift) then Label1.Caption := Label1.Caption + 'ssLeft ';
     if (ssRight in Shift) then Label1.Caption := Label1.Caption + 'ssRight ';
     if (ssMiddle in Shift) then Label1.Caption := Label1.Caption + 'ssMiddle ';
     if (ssDouble in Shift) then Label1.Caption := Label1.Caption + 'ssDouble ';
end;

Open in new window

0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 24287952
ssLeft means on the left side of the keyboard
ssRight ...
0
 

Author Comment

by:inampudi1
ID: 24288985
Thank you steve and geert.

          Could you suggest me any tutorials on this topic.

                              Thank you
0
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 1500 total points
ID: 24294024
delphi.about.com has a lot on stuff like this.

http://delphi.about.com/od/vclusing/a/mouseevents.htm

0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 24304178
a B grade goes with a comment.
giving no comment implies you give an A grade

read the suggestions on grading ...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question