I need a panel that I can make visible/invisible on a buton click and will
float/drag on a screen form.
Thanks.
In order to make any TWinControl draggable at run-time, you need to use
a special Windows message whose value is $F012. Following is a snippet
of code to demonstrate how to use this. Start a new application and drop
a TPanel on the form. Then in the panel's OnMouseDown event enter the
following code:
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
SC_DRAGMOVE = $F012;
begin
if Button = mbLeft then
begin
SetCaptureControl(nil);
TPanel(Sender).Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);
end;
end;
Now run the application and use the left mouse button to click and drag
the panel.
Hope this helps,
Larry
--
Larry J. Rutledge
la...@prestwood.com
Programmer / Analyst
Prestwood Software & Consulting
7525 Auburn Blvd., #8
Citrus Heights, CA 95610
Office: 1 (916) 726-5675 x214
Fax: 1 (916) 726-5676
http://prestwood.net - Business Site
http://prestwood.com - FREE world wide internet environment
--
Martijn Tonies
Upscene Productions
For Delphi Components and InterBase tools:
http://www.upscene.com
"Larry J. Rutledge" <la...@prestwood.com> wrote in message
news:38971830...@prestwood.com...
I've also came across this statement which may help
var ScreenPos: TRect;
begin
Panel.borderstyle := bsNone;
screenpos := rect(5, 194, 771, 361);
Panel.ManualFloat(screenpos);
Panel.visible := false;
"John Francis Lundy" <jfl...@tamesystems.com> wrote in message
news:879dn9$26...@bornews.borland.com...