Back

Sometimes, I am in a situation where I need to be able to move a form which has no caption bar.
I have seen many examples on the Web which involve handling all sorts of Window messages, and the code is quite bulky. Just add this to the onMouseDown event of the form(or a component you might like to use as a "Caption")

Releasecapture; {Not quite sure what this means, but}
                {You may have problems if it is not used}
Form1.Perform(WM_SYSCOMMAND, $F012, 0);

This assumes the form is named Form1 .
The code could also be applied to any other control, such as a button or panel, e.g.

Releasecapture;
Panel1.Perform(WM_SYSCOMMAND, $F012, 0);

"Jon Nichols" <jonnichols@hotmail.com>


Back