1

I have a Delphi 6 program that allows the user to drag controls around the page. I do it by using the following code in the MouseDown event.

ReleaseCapture;                              
TWinControl(Sender).perform(WM_SYSCOMMAND,$F012,0);

How can I draw a set of lines aligned with the left side and the top of the object being dragged so the user can align the control with other controls (similar to the XE2 design)?

Warren P
  • 65,725
  • 40
  • 181
  • 316
Steve
  • 640
  • 1
  • 7
  • 19
  • I have no Delphi XE2. Could you please add an illustrative picture of what do you mean with the alignment indicator (if possible) ? Did you mean [`something like this`](http://wiki.lmd.de/uploads/d/d3/NewDockPanel.png) ? – TLama Aug 22 '12 at 17:21
  • 1
    @TLama, the OP refers to the [Design Guidelines](http://docwiki.embarcadero.com/RADStudio/en/Using_Design_Guidelines_with_VCL_Components) – RRUZ Aug 22 '12 at 17:22
  • 2
    Try this question [Equivalent to designer guidelines in code](http://stackoverflow.com/questions/6923936/equivalent-to-designer-guidelines-in-code) – RRUZ Aug 22 '12 at 17:31
  • I don't need it to detect other controls I just need to draw lines as the control moves so you can see the alignment. – Steve Aug 22 '12 at 17:37
  • 1
    Steve: step 1. reimplement the entire "form designer" in your own code and forget about performing WM_SYSCOMMANDs. step 2. draw lines. The Jedi form design component source code will be helpful to you.\ – Warren P Aug 22 '12 at 18:54

0 Answers0