The easiest way to do this is to "cheat" the system so that he thinks it's the header row of the form
.
Unit Dragmain
Interface
uses
Sysutils, Wintypes, Winprocs, Messages, Classes, Graphics, controls,< br> Forms, Dialogs, Stdctrls;
Type
TForm1 = Class (Tform)
Button1:tbutton
Procedure Button1Click (sender:tobject);
Private
PR Ocedure Wmnchittest (var m:twmnchittest); Message wm_nchittest;
End;
Var
Form1:tform1
Implementation
{$R *. DFM}
Procedure tform1.wmnchittest (var m:twmnchittest);
Begin
inherited; {Call the inherited message handler}
If M.result = Htclient then {is the "click in" Client area?}
M.result: = htcaption; {If so, make Windows?
{on the caption bar.}
End;
Procedure Tform1.button1click (sender:tobject);
Begin
Close,
end,
end.
{The following is the form's settings}
Object Form1:tform1
Left = 203
top = bordericons
= []
BorderStyle = bsnone
ClientHeight = 273
ClientWidth = 427
Font.Color = clwindowtext
Font.height = -13
FoNt. Name = System
Font.style = []
PixelsPerInch =
TextHeight = +
Object Button1:tbutton
Left = 160
top =
Width = $
Height = Caption
= Close
TabOrder = 0
OnClick = Button1Click
End
End