Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

form with anywhere drag properties

Posted on 2002-04-24
6
Medium Priority
?
169 Views
Last Modified: 2010-04-04
How can I create a form that I can click and drag anywhere on it's surface, not just on the caption bar?
Thanks,
Paul
0
Comment
Question by:annas
[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
6 Comments
 
LVL 5

Accepted Solution

by:
Gwena earned 400 total points
ID: 6967064
Hi :-)

  For easy questions always try this delphi search

sitehttp://www.jounlai.com/3kdt/index.cgi


Here is a link to the info you need... I got it from the search page :-)


http://delphi.about.com/library/weekly/aa061300a.htm


There were a bunch more links... just search using 'drag'

0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 6967334
I use :

procedure TForm1.MouseDown(...);
begin
  ReleaseCapture;
  SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
end;

the idea is to 'trick' the window we're holding it by it's caption bar
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6967792
well, my version

unit moving_whole_form_u;

interface

uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls;

type
 TForm1 = class(TForm)
   CheckBox1: TCheckBox;
 private
   procedure WMNCHitTest(var Message : TWMNCHitTest); message WM_NCHITTEST;
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.WMNCHitTest(var Message : TWMNCHitTest);
begin
 inherited;
 if checkbox1.checked then  //Moving Toggle on/off check
   if message.result = HTCLIENT then //client-area
     message.result := HTCAPTION;  //do so if the caption is clicked
end;

end.


meikl ;-)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6967793
gwena's second link is a good one :-)
0
 

Author Comment

by:annas
ID: 6967848
Yes that Worked Thanks Gwena and thanx for the search sitre!
Paul :)
0
 
LVL 5

Expert Comment

by:Gwena
ID: 6968753
Your welcome annas :-)

That search site has helped me out a lot!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

610 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