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;

    好不容易活着
  • 相关阅读:
    删DS.Store
    switch 多重选择
    PrintWrite写入文件
    读取文件
    notepad++如何把文件保存为java文件
    让notepad++成为轻量级JAVA的IDE
    Jenkins构建Python项目提示:'python' 不是内部或外部命令,也不是可运行的程序
    相关服务账号
    Jenkins安装与启动
    jmeter安装
  • 原文地址:https://www.cnblogs.com/iwana/p/13596779.html
Copyright © 2011-2022 走看看