?
Solved

TCustomControl DragOver Event

Posted on 2007-11-28
3
Medium Priority
?
700 Views
Last Modified: 2013-11-23
I am trying to teach myself drag'n'drop in Delphi and have created a component (TMyControl) which is a descendant of TCustomControl and have published the OnDragOver event:

TMyControl = class(TCustomControl)
:
  private
    { Private declarations }
    FOnDragOver: TDragOverEvent;
:
  published
    { Published declarations }
    property OnDragOver: TDragOverEvent read FOnDragOver write FOnDragOver;
:
end;

I have written code for MyControl1DragOver:

procedure TForm1.MyControl1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
:
  // some code in here just to prove it works
:
end;

But, this event does not fire when I drag something over MyControl1.

What more should I do to get MyControl1 to fire its DragOver event?
0
Comment
Question by:plumothy
[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
3 Comments
 
LVL 26

Accepted Solution

by:
EddieShipman earned 2000 total points
ID: 20368895
Put a breakpoint in TWinControl.CMDrag and see if it breaks there.
0
 

Author Comment

by:plumothy
ID: 20370003
Yes, it breaks in TWinControl.CMDrag when dragging over the control.

Thanks for that. I am quickly learning a lot about drag and drop!

I have followed the code execution in the debugger and can see where I have gone wrong.

I had a second control contained in MyControl1and it was this second control which fires its DragOver event - not MyControl1.

Once again, thanks for pointing me in the right direction.
0
 

Author Closing Comment

by:plumothy
ID: 31411407
The solution pointed me in the right direction so I quickly found out what I had done wrong!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
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…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

800 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