How to Move a form by clicking in its client area ?



How to Move a form by clicking in its client area ?..

Answer / Vikas Kumar Verma

To move a form by clicking in its client area in Delphi, you can override the WM_MOUSEMOVE message in the WndProc and handle the form's movement logic there.nnExample:nnprocedure TForm1.WndProc(var Message: TMessage);nbeginn if (Message.Msg = WM_MOUSEMOVE) thenn MoveTo(ClientRect.Left + (OldMousePosition.x - Message.X), ClientRect.Top + (OldMousePosition.y - Message.Y));n inherited;nend;nnprocedure TForm1.FormCreate(Sender: TObject);nbeginn OldMousePosition := Point(0, 0); // Initialize old mouse positionnend;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Delphi Interview Questions

How to Change the root key ?

1 Answers  


How to Flush binary file from disk cache to disk ?

0 Answers  


How to Set the MaxPage property of the PrintDialog component?

1 Answers  


How to Find the column and row of the cursor in a TRichEdit?

1 Answers  


"EOleSysError : Error loading type library/DLL" . what does this error mean?

1 Answers  


Does the BDE use Client side or server side cursors for MSSQL?

1 Answers  


How to create an executible file using the command line directive in Linux with Kylix?

1 Answers  


what are the files that need to be included with applications using MSACCESS?

1 Answers  


How to Create a palette with more than one entry ?

1 Answers   Wipro,


How to Determine the last access time of a given file ?

0 Answers   IBM,


Compare the similarities and differences among Sockets, DCOM, OLE Enterprise?

1 Answers  


Is it possible to connect to InterBase from a Delphi app without using the BDE?

1 Answers  


Categories