unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Panel1: TPanel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
Constraints.MinHeight := Height;
Constraints.MaxHeight := Height;
Constraints.MinWidth := Width;
Constraints.MaxWidth := Width;
Panel1.Top := Form1.Top + Form1.Height;
Panel1.Left := 0;
Panel1.Width := Form1.Width - 1;
Panel1.BevelInner := bvLowered;
Timer1.Interval := 20;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
case ScreenToClient(Mouse.CursorPos).Y > Height -20 of
True:
begin
if Panel1.Top > Form1.Height - Panel1.Height - 1 then
Panel1.Top := Panel1.Top - 5;
if Panel1.Top < Form1.Height - Panel1.Height then
Panel1.Top := Form1.Height - Panel1.Height - 1;
end;
False:
begin
if Panel1.Top < Form1.Height then
Panel1.Top := Panel1.Top + 5;
end;
end;
end;
end.