Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi TPanel ein-/ausblenden (https://www.delphipraxis.net/39863-tpanel-ein-ausblenden.html)

Aenogym 8. Feb 2005 13:46


TPanel ein-/ausblenden
 
hi ihr,

mit folgendem code kann ich ein fenster ein- und ausblenden lassen (fade effekt):
Delphi-Quellcode:
form.BringToFront;
AnimateWindow(form.Handle, 250, AW_BLEND {or AW_HIDE});
form.Show;
form.refresh;
klappt ganz gut. nun hab ich das auch für ein TPanel veruscht - erfolglos :(

ich hab schon gesucht, aber nicht mal die schwizer haben einen tipp, wie ich ein control ein- und ausblenden kann.
es sollte für ein TPanel funktionieren, weil ich dessen captio-property nutze, und das panel top-aligned sein soll.

habt ihr einen tipp für mich?

danke schlnmal,
Aenogym

Sprint 8. Feb 2005 20:56

Re: TPanel ein-/ausblenden
 
Zitat:

Zitat von Aenogym
ich hab schon gesucht, aber nicht mal die schwizer haben einen tipp, wie ich ein control ein- und ausblenden kann.

Hast aber nicht im Microsoft Platform SDK gesucht. Weil dort steht, warum's nicht geht.

Zitat:

The function will fail in the following situations:
  • If the window uses the window region. Windows XP: This does not cause the function to fail.
  • If the window is already visible and you are trying to show the window.
  • If the window is already hidden and you are trying to hide the window.
  • If there is no direction specified for the slide or roll animation.
  • When trying to animate a child window with AW_BLEND.

Außerdem steht noch bei der Beschreibung von dwFlags:
Zitat:

AW_BLEND
Uses a fade effect. This flag can be used only if hwnd is a top-level window.
Und dein Panel wird wohl kein TopLevel Fenster sein.

Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Panel1.Visible := False;
end;
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin

  AnimateWindow(Panel1.Handle, 500, AW_ACTIVATE or AW_HOR_POSITIVE);
  AnimateWindow(Panel1.Handle, 500, AW_HIDE or AW_HOR_NEGATIVE);

end;

Aenogym 13. Feb 2005 15:27

Re: TPanel ein-/ausblenden
 
Zitat:

Zitat von Sprint
Hast aber nicht im Microsoft Platform SDK gesucht. Weil dort steht, warum's nicht geht.

:oops: stimmt allerdings

vielen, vielen dank für die hilfe,
Aenogym


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:43 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-2025 by Thomas Breitkreuz