zoukankan      html  css  js  c++  java
  • 通过例子来简单了解下TProgressBar的使用。 pas文件程序如下

    unit Unit4;
     
    interface
     
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ComCtrls;
     
    type
      TForm4 = class(TForm)
        progress: TProgressBar;
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
     
    var
      Form4: TForm4;
     
    implementation
     
    {$R *.dfm}
     
    procedure TForm4.FormCreate(Sender: TObject);
    var
      I: Integer;
    begin
      try
        progress.Max := 100;
        for I := 0 to 100 - 1 do
        begin
          Application.ProcessMessages;
          progress.Position := I;
          Sleep(50);
        end;
      finally
        //progress.Max := 0;
      end;
      
    end;
     
    end.

    fram文件如下:

    object Form4: TForm4
      Left = 0
      Top = 0
      Caption = 'Form4'
      ClientHeight = 300
      ClientWidth = 635
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      OldCreateOrder = False
      OnCreate = FormCreate
      PixelsPerInch = 96
      TextHeight = 13
      object progress: TProgressBar
        Left = 0
        Top = 283
        Width = 635
        Height = 17
        Align = alBottom
        TabOrder = 0
      end
    end

    实际运行结果如图所示:

     以上程序即可简单的使用TProgressBar。

  • 相关阅读:
    Docker之概述
    redis命令
    spring mvc(1) 为什么要使用mvc
    学习到的
    HttpWebRequest简单使用
    推手总结
    react 生命周期
    利用反射对应数据库字段
    扩展方法
    发送请求并返回
  • 原文地址:https://www.cnblogs.com/jijm123/p/12602675.html
Copyright © 2011-2022 走看看