Einzelnen Beitrag anzeigen

drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#1

delphi TadvGlowbutton Click

  Alt 18. Okt 2014, 04:37
i am about to understand how to show a form on click and hide it on click on the same button again

here is how i show the form

Delphi-Quellcode:
procedure TMAIN.btnVolClick(Sender: TObject);
var
  Rect: TRect;
  volfrm : Tvolfrm;
begin
volfrm := Tvolfrm.Create(nil);
try
  GetWindowRect(btnVol.Handle, Rect);
  if not Assigned(volfrm) then
  begin
    volfrm:= Tvolfrm.CreateParented(0);
    volfrm.FormStyle := fsStayOnTop;
  end;

  volfrm.Left := Rect.Left;
  volfrm.top := Rect.Top - volfrm.Height;
finally
volfrm.Show;
end;
end;
how to hide the for again on click the same button
  Mit Zitat antworten Zitat