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;

    好不容易活着
  • 相关阅读:
    python cookbook 笔记二
    python cookbook 笔记一
    aircrack-ng笔记
    TeamCity 和 Nexus 的使用
    Linux 搭建 nexus 私服【转】
    maven阿里云镜像
    kali linux 破解wpa密码
    python正则表达式二[转]
    Java并发编程:Synchronized底层优化(偏向锁、轻量级锁)
    集合解析
  • 原文地址:https://www.cnblogs.com/iwana/p/13596779.html
Copyright © 2011-2022 走看看