Here's is my code:
type TNav = class(TPanel)
private
procedure CMMouseEnter(var AMsg: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var AMsg: TMessage); message CM_MOUSELEAVE;
public
end;
type TForm1 = class(TForm)
...
procedure FormCreate(Sender: TObject);
private
public
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
with TNav.Create(Form1) do begin
Parent := Self;
Name := 'nav';
Top := 0;
Left := 0;
Height := 27;
Width := Form1.Width - 8;
Visible := true;
Caption := '';
end;
end;
procedure TNav.CMMouseEnter(var AMsg: TMessage);
begin
Self.Top := 0;
end;
procedure TNav.CMMouseLeave(var AMsg: TMessage);
begin
Self.Top := -23;
end;
Is there a way to add an onResize event for my TNav, or even to send the width/height values from the Form1?
Thank you in advance!