u1.pas

来自「日历记事本 日历记事本 日历记事本 日历记事本 日历记事本 日历记事本 日历记事」· PAS 代码 · 共 52 行

PAS
52 行
字号
unit U1;

interface

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

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
Var
 i,j:integer;
begin
stringgrid1.Cells[0,0]:='九九乘法表';
for j:=1 to 9 do
for i:=1 to j do
    begin
      stringgrid1.Cells[i,0]:=IntToStr(i);
      stringgrid1.Cells[0,j]:=IntToStr(j);
      stringgrid1.Cells[i,j]:=IntToStr(j)+'*'+IntToStr(i)+ '='+IntToStr(i*j);
     end;
end;



procedure TForm1.Button2Click(Sender: TObject);

begin
  close;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?