Re:Dragable panel = Making panel on click drag Form1
In comp.lang.pascal.delphi.misc, on 17 Oct 2002, DanB
announced:
Quote
> I have a panel, how do i get it to resize with wize as
> someone re-sizes my forum...
Hi dAn,
To make the panel resize with your form, put something in the
form's OnResize method - ie (this is off the top of my head,
apologies for mistakes ;):
Form1.OnResize(Sender: Object);
begin
// ClientWidth/Height are the usable area of the form
// They already take into consideration a MainMenu
// and border width and titlebar, but not toolbar
// or statusbar.
// the panel's left position is 10 say,
// let's make it the width of the form with a 10 pixel
// gap either side.
myPanel.Width:=Form1.ClientWidth - 20;
// Let's position the panel 1/4 of the way from the
// top of the form, and make it half the height of
// the form.
myPanel.Top:=(Form1.ClientHeight shr 2);
myPanel.Height:=(Form1.ClientHeight shr 1);
end;
Quote
> ... and how do i get it so on click
> of the panel it starts dragging Form1?
That's a bit harder and is something I haven't tried before, but
I know you can do it. Try playing with the form and the panel's
OnDragOver, OnStartDrag, OnEndDrag, OnMouseMove methods, or
perhaps just have a search through google, I'm sure the question
has been asked before. Sorry I can't help more there.
Regards
OgO
--
My Freeware: http://qjc.cjb.net/freeware.html
My Win9x Cursors: http://qjc.cjb.net/cursors.html
ICQ: 12889482 - AIM/Yahoo: quentisl - MSN: quent...@mail.com
I left my Glasses in my email - you better take them out!