美文网首页
2018-09-28 从1加到10000 progre

2018-09-28 从1加到10000 progre

作者: netppp | 来源:发表于2018-09-28 13:00 被阅读0次

    unit Unit3;

    interface

    uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs,system.json,Vcl.StdCtrls,
    IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,
    Vcl.ComCtrls;

    type
    TForm3 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    ProgressBar1: TProgressBar;
    procedure Button1Click(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form3: TForm3;

    implementation

    {$R *.dfm}

    procedure TForm3.Button1Click(Sender: TObject);
    var
    a,b:integer;
    begin
    b:=0;
    progressbar1.max:=10000;
    progressbar1.Position:=1;
    for a := 1 to 10000 do
    begin
    application.ProcessMessages;
    b:=b+a;
    progressbar1.Position:=a;
    label1.Caption:= inttostr(a);
    end;
    showmessage(inttostr(b));
    //从1加到10000
    end;

    end.

    相关文章

      网友评论

          本文标题:2018-09-28 从1加到10000 progre

          本文链接:https://www.haomeiwen.com/subject/outpoftx.html