![]() |
delphi TadvGlowbutton Click
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:
how to hide the for again on click the same button
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; |
AW: delphi TadvGlowbutton Click
There are a few ways to do so.
it depends on ..... do you just wanna Show and hide ? or do you want to create and destroy on button click = |
AW: delphi TadvGlowbutton Click
This is one of several ways (still quite dirty):
Delphi-Quellcode:
type
TMAIN = class(TForm) private FOtherFormVisible: Boolean; FVolFrm: TVolFrm; procedure SetOtherFormVisible(Value: Boolean); function GetVolFrm: TVolFrm; property OtherFormVisible: Boolean read FOtherFormVisible write SetOtherFormVisible; property VolFrm: TVolFrm read GetVolFrm; ... end; ... procedure TMAIN.SetOtherFormVisible(Value: Boolean); begin FOtherFormVisible := Value; if FOtherFormVisible then (* Using the property, not the private field due to lazy initialization *) VolFrm.ProceedShowCode else VolFrm.ProceedHideCode; end; function TMAIN.GetVolFrm: TVolFrm; begin if not Assigned(FVolFrm) then FVolFrm := TVolFrm.Create(nil); Result := FVolFrm; end; (* Click-Code left *) procedure TMAIN.btnVolClick(Sender: TObject); begin (* Accessing the property to call its Setter *) OtherFormVisible := not OtherFormVisible; end; |
AW: delphi TadvGlowbutton Click
Thanks thats helps alot
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:26 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz