Solved

MousePosition

Posted on 1997-12-29
1
121 Views
Last Modified: 2010-04-04
Hi,
I would like to know in a DBGRIDDBLClick procedure what the mouse position is (X,Y). How can I do this?
0
Comment
Question by:lizzzard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
Felixin earned 50 total points
ID: 1354832
A DBGrid is a component derived from TControl.

If you look on the events list of TControl, you will find an OnMouseMove event that you can use to get the X and Y coordinates of the mouse position.

Further, you can use the MouseCoord procedure of the DBGrid Object to transform the X and Y coordinates of the mouse, into the Row and Column of the DBGrid cell.

The only problem that you can have here, is that the OnMouseMove event does not appear in the object inspector events tab. I think you can solve the problem by inserting a line of code assigning your event handler to that event when the form is first created (using the FormCreate procedure).
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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