Code:
unit Rendevouztd; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, XPMan; type TForm1 = class(TForm) StringGrid1: TStringGrid; Button1: TButton; Button2: TButton; XPManifest1: TXPManifest; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var i,kolom,baris :integer; begin for kolom:=1 to 10 do StringGrid1.Cells[kolom,0] := IntToStr(kolom); for baris:=1 to 10 do StringGrid1.Cells[0,baris] := IntToStr(baris); end; procedure TForm1.Button1Click(Sender: TObject); var kolom,baris:integer; begin StringGrid1.Cells [0,0]:=' + '; for kolom :=1 to 10 do for baris := 1 to 10 do StringGrid1.Cells [kolom,baris]:= IntToStr(kolom+baris); end; procedure TForm1.Button2Click(Sender: TObject); var kolom,baris:integer; begin StringGrid1.Cells [0,0]:=' * '; for kolom :=1 to 10 do for baris := 1 to 10 do StringGrid1.Cells [kolom,baris]:= IntToStr(kolom*baris); end; end.
Tidak ada komentar:
Posting Komentar