?
Solved

MousePosition

Posted on 1997-12-29
1
Medium Priority
?
123 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 100 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

719 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