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 |
How to Change the root key ?
How to Flush binary file from disk cache to disk ?
How to Set the MaxPage property of the PrintDialog component?
How to Find the column and row of the cursor in a TRichEdit?
"EOleSysError : Error loading type library/DLL" . what does this error mean?
Does the BDE use Client side or server side cursors for MSSQL?
How to create an executible file using the command line directive in Linux with Kylix?
what are the files that need to be included with applications using MSACCESS?
How to Create a palette with more than one entry ?
How to Determine the last access time of a given file ?
Compare the similarities and differences among Sockets, DCOM, OLE Enterprise?
Is it possible to connect to InterBase from a Delphi app without using the BDE?