Solved

StringGrid.OnSelect

Posted on 2006-06-22
4
549 Views
Last Modified: 2010-04-04
Why does clicking on a StringGrid cell when the DragMode is set dmAutomatic not call the OnSelect event? Instead I noticed that it calls the StartDrag event.  I want the StringGrid to allow the selection of a cell as if the DragMode was set dmManual, and when the the mouse button is held down to begin a drag of the StringGrid cell's object.  Many thanks.
0
Comment
Question by:Vector7
[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
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:RickJ
ID: 16958573
In the mousedown event of the stringgrid do this...

if (Button = mbLeft) then
    StringGrid1.BeginDrag (false) ;

Please look at help for impact of BeginDrag parameters. Very important.
Then in the target control use the dragover and dragdrop method to handle your drop.

Hope this helps.
0
 

Author Comment

by:Vector7
ID: 16959171
Thankyou RickJ for replying. I've tried your suggestion but the StringGrid still doesn't call the On Select event.
0
 
LVL 8

Accepted Solution

by:
RickJ earned 125 total points
ID: 16965194
I dont think I am clear in what you are trying to do.
My comment was assuming that you would use dmManual.
But on reading your comment again, I see that you still want to use dmAutomatic?
And make onselect execute for dmAutomatic?
Why not use dmManual instead of dmAutomatic?
Just trying to get a picture of what you are actually trying to do.

Thanks
Rick.
0
 

Author Comment

by:Vector7
ID: 16970776
Thanks for your help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 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