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。

  • 相关阅读:
    iOS App之间跳转
    iOS 编码转换
    iOS文件类型判断
    iOS 运行时
    libqrencode生成二维码
    设置app的启动图
    根据字体计算CGRect
    iOS 英文学习
    libev 中IO事件循环解析
    libev 默认事件循环初始化的解析
  • 原文地址:https://www.cnblogs.com/jijm123/p/12602675.html
Copyright © 2011-2022 走看看