⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit2~1.~pa

📁 该程序用Delphi实现了一个不错的3D动画播放
💻 ~PA
字号:
unit Unit2;

interface

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

type
  TForm2 = class(TForm)
    StringGrid1: TStringGrid;
    SpeedButton1: TSpeedButton;
    procedure FormShow(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;
  myRect: tgridrect;

  records1:array[1..10,1..3] of string;

implementation

uses Unit1;

{$R *.DFM}

procedure TForm2.FormShow(Sender: TObject);
begin
stringgrid1.Ctl3D:=false;
stringgrid1.GridLineWidth:=1;
stringgrid1.ClientWidth:=stringgrid1.GridWidth;
stringgrid1.ClientHeight:=stringgrid1.GridHeight;
speedbutton1.Left:=0;
speedbutton1.Top:=stringgrid1.Height;
speedbutton1.Width:=stringgrid1.Width;

form2.ClientWidth:=stringgrid1.Width;
form2.ClientHeight:=speedbutton1.Top+speedbutton1.Height;
form2.Left:=(screen.Width-form2.Width) div 2;
form2.Top:=(screen.Height-form2.Height) div 2;

{myRect.Left := 0;
myRect.Top := 2;
myRect.Right := 1;
myRect.Bottom := 2;
StringGrid1.Selection := myRect;}
end;

procedure TForm2.FormCreate(Sender: TObject);
var i,j:integer;
    f1:textfile;
begin
stringgrid1.ColWidths[0]:=20;
stringgrid1.ColWidths[1]:=200;
stringgrid1.ColWidths[2]:=40;

myRect.Left := 0;
myRect.Top := -1;
myRect.Right := 2;
myRect.Bottom := -1;
StringGrid1.Selection := myRect;

assignfile (f1,'records.dat');
reset (f1);
for i:=1 to 10 do begin
    records1[i,1]:=inttostr(i);
    readln(f1,records1[i,2]);
    readln(f1,records1[i,3]);
end;
closefile(f1);

for i:=1 to 10 do begin
    for j:=1 to 3 do begin
        stringgrid1.Cells[j-1,i-1]:=records1[i,j];
    end;
end;


end;

end.

⌨️ 快捷键说明

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