Board index » delphi » Movable from anywhere...

Movable from anywhere...

I want to make my forms movable from every pixel on the form(that doesn't
belong to a component). I mean I don't want to be stuck for moving my
program form by the statusbar. I should be able to grab it from anywhere I
want. Anybody with an opinion? Thanx in advance...

--
Posted via CNET Help.com
http://www.help.com/

 

Re:Movable from anywhere...


Quote
"Emre TOPTANCI" <emretopta...@yahoo.com> wrote in message

news:tdektu1n885411@corp.supernews.com...

Quote
> I want to make my forms movable from every pixel on the form(that doesn't
> belong to a component). I mean I don't want to be stuck for moving my
> program form by the statusbar. I should be able to grab it from anywhere I
> want. Anybody with an opinion? Thanx in advance...

just add this to your form's mousedown event

const
  SC_DRAGMOVE = $F012;
begin
  ReleaseCapture;
  TWinControl(Sender).Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);
end;

D.

Re:Movable from anywhere...


This is the VB code for doing it - it is just APIs so you can probably
translate it faster than me ( OO:08 GMT )

       ReleaseCapture  //  Release Mouse Capture from this Form
       // inform the form that there is a click on the Caption area
       // obviously a lie - but Windows is gullible

       SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&

On Fri, 13 Apr 2001 19:30:06 -0000, Emre TOPTANCI

Quote
<emretopta...@yahoo.com> wrote:
>I want to make my forms movable from every pixel on the form(that doesn't
>belong to a component). I mean I don't want to be stuck for moving my
>program form by the statusbar. I should be able to grab it from anywhere I
>want. Anybody with an opinion? Thanx in advance...

>--
>Posted via CNET Help.com
>http://www.help.com/

Other Threads