zoukankan      html  css  js  c++  java
  • Delphi 动态生成进度条窗体

    在implementation加入下面
    
    uses
      Gauges;
     var Gauge1: TGauge;
     
    加入Timer1控件,设为false 
     
    procedure TForm1.Button1Click(Sender: TObject);
    var
      form2: TForm;
    begin
      form2 := TForm.Create(nil);
      form2.BorderStyle := bsNone;
      form2.Width := 360;
      form2.Height := 30;
      form2.Position := poMainFormCenter;
      Gauge1 := TGauge.Create(form2);
      Gauge1.MinValue := 0;
      Gauge1.MaxValue := 100;
      Gauge1.Width := form2.ClientWidth - 2;
      Gauge1.Height := 30;
      Gauge1.Left := 10;
      Gauge1.Top := (form2.ClientHeight - Gauge1.Height) div 2;
      Gauge1.Parent := form2;
      Timer1.Interval := 100;
      Timer1.Enabled := True;
      form2.ShowModal;
      form2.Free;
      Timer1.Enabled := False;
    end;
    
    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
      if Assigned(Gauge1) then
      begin
        Gauge1.Progress := Gauge1.Progress + 1;
        if Gauge1.Progress = Gauge1.MaxValue then
          TForm(Gauge1.Parent).ModalResult := 1;
      end;
    
    end;
  • 相关阅读:
    HDU_5057_分块
    HYSBZ_2002_分块
    HDU_1166_树状数组
    HDU_5692_dfs序+线段树
    多重背包
    二进制中一的个数
    康托展开
    vector, map, queue,set常用总结
    错误票据
    高精度计算
  • 原文地址:https://www.cnblogs.com/windson/p/12505318.html
Copyright © 2011-2022 走看看