Dear All,

Please let me know what is wrong or missing for it from the attached document. One of them is my work (T9.zip) and the other is the demo

Cheers,

Recommended Answers

All 3 Replies

unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    Image1: TImage;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
var
  count: integer;
begin
  for count := 1 to 10 do
  begin
    Image1.Picture.LoadFromFile('T'+ IntToStr(count)+'.bmp');
    sleep(100);
    update;
  end;
end;

end.

Hi,

Thank you for your kind reply and help. But could you mind tell me why I cannot put 'for count := 1 to 10 do' to the program?

Cheers,

unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    Image1: TImage;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
var
  count: integer;
begin
  for count := 1 to 10 do
  begin
    Image1.Picture.LoadFromFile('T'+ IntToStr(count)+'.bmp');
    sleep(100);
    update;
  end;
end;

end.

Check this:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.