zoukankan      html  css  js  c++  java
  • delphi fmx 控件从天上掉下来

    可转载  请 标注 来源

    procedure TForm4.FormCreate(Sender: TObject);
    begin
    FOldPostion := TStringList.Create;
    end;

    procedure TForm4.HideAllControl(vshow: boolean);
    var
    i, j,x: Integer;
    y, k: Single;
    begin

    if not vshow then
    begin
    FOldPostion.Clear;
    for i := 0 to ComponentCount - 1 do
    begin
    if Components[i] is TControl then
    begin
    y := (Components[i] as TControl).Position.y;
    FOldPostion.Values[(Components[i] as TControl).Name] := y.ToString();

    j := Round(y);
    x := 1;
    repeat
    (Components[i] as TControl).Position.y := j;
    (Components[i] as TControl).Opacity := j / 10;
    Sleep(3);
    Application.ProcessMessages;
    Updated;
    inc(j, x); //速度
    inc(x);
    until j >= ClientHeight;

    (Components[i] as TControl).Visible := vshow;

    end;
    end;

    end
    else
    begin
    for i := 0 to ComponentCount - 1 do
    begin
    if Components[i] is TControl then
    begin
    (Components[i] as TControl).Visible := vshow;
    y := 0;
    x := 1;
    j := Round(y);
    k := StrToInt(FOldPostion.Values[(Components[i] as TControl).Name]);
    repeat
    (Components[i] as TControl).Position.y := j;
    (Components[i] as TControl).Opacity := j / 10;
    Sleep(3);
    Application.ProcessMessages;
    Updated;
    inc(j, x);
    Inc(x);
    until j >= k;

    end;
    end;

    end;

    end;

    procedure TForm4.Button1Click(Sender: TObject);
    begin
    TThread.CreateAnonymousThread(
    procedure
    begin
    HideAllControl(False);
    HideAllControl(true);
    end).Start;

    end;

    好不容易活着
  • 相关阅读:
    NetBeans + Struts + Hibernate 入门教程
    The Perils of JavaSchools
    Java 2 EE 开发初体验
    五周年记
    MySQL Workbench 介绍
    JAVA语言学校的危险性
    娱乐无处不在 Sun工程师惊天发现:大吼可致硬盘潜伏期激增
    争什么?
    spring cloud使用zuul实现反向代理和负载均衡
    spring cloud 网管篇zuul
  • 原文地址:https://www.cnblogs.com/iwana/p/13596779.html
Copyright © 2011-2022 走看看