I do not know how to call an interactive panel of tools like TeamViewer has. My question is very objective: How can I create a interactive panel where the panel will hide/show at any moment?
EDIT:
I found a possible solution (code below). Now I want to insert a "Button
" glued on the right side and below Panel
. How can I make this?
procedure TForm1.btn1Click(Sender: TObject);
begin
AnimateWindow(Panel1.Handle, 800, AW_SLIDE or AW_VER_NEGATIVE or AW_HIDE);
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
AnimateWindow(Panel1.Handle, 800, AW_SLIDE or AW_VER_POSITIVE or AW_ACTIVATE);
end;
type
TForm1 = class(TForm)
pnl1: TPanel;
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
begin
if btn1.Caption = 'H' then
begin
btn1.Top := 0;
btn1.Caption := 'S';
AnimateWindow(Pnl1.Handle, 400, AW_SLIDE or AW_VER_NEGATIVE or AW_HIDE);
end
else
begin
btn1.Top:= pnl1.Height;
btn1.Caption := 'H';
AnimateWindow(Pnl1.Handle, 400, AW_SLIDE or AW_VER_POSITIVE or AW_ACTIVATE);
end;
end;
end.
This was my solution:
I'm still using
AnimateWindow
api.
Button
properties, set right = 0
Panel
is visible, the Button
have top := Panel.Height
Panel
is no-visible (hidden), Button
have top := 0