delphi成绩录入程序
根据小甲鱼delphi第17讲动态数组的上机练习要求编写的程序,初学入门,各位大神多多指教{:5_92:}unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, ExtCtrls;
type
TForm1 = class(TForm)
pnl1: TPanel;
strngrd1: TStringGrid;
txt1: TStaticText;
edt1: TEdit;
btn1: TButton;
btn2: TButton;
txt2: TStaticText;
txt3: TStaticText;
txt4: TStaticText;
edt2: TEdit;
edt3: TEdit;
edt4: TEdit;
procedure FormCreate(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
var
person: Integer = 0;
currt: Integer = 0;
cj_arr: array of array of string;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
person:= StrToInt(InputBox('请输入', '请输入总人数: ', ''));
btn1.Caption:= '成绩录入' + '(' + IntToStr(currt) + '/' + IntToStr(person) + ')';
btn2.Enabled:= False;
SetLength(cj_arr, 4, person);
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
currt:= currt + 1;
cj_arr:= edt1.Text;
cj_arr:= edt2.Text;
cj_arr:= edt3.Text;
cj_arr:= edt4.Text;
edt1.Text:= '';
edt2.Text:= '';
edt3.Text:= '';
edt4.Text:= '';
btn1.Caption:= '成绩录入' + '(' + IntToStr(currt) + '/' + IntToStr(person) + ')';
if (currt = person) then
begin
btn2.Enabled:= True;
btn1.Enabled:= False;
edt1.Enabled:= False;
edt2.Enabled:= False;
edt3.Enabled:= False;
edt4.Enabled:= False;
end;
end;
procedure TForm1.btn2Click(Sender: TObject);
var
i,j: Integer;
begin
strngrd1.RowCount := person + 1;
strngrd1.Cells:= '语文';
strngrd1.Cells:= '英语';
strngrd1.Cells:= '数学';
strngrd1.Height:= ( person + 1 ) * strngrd1.DefaultRowHeight + 10;
strngrd1.Width:= 360;
for i:= 0 to (person-1) do
begin
for j:= 0 to 3 do
begin
strngrd1.Cells:= cj_arr;
end;
end;
strngrd1.Visible:= True;
end;
end.
据说现在delphi的工作挺少的,不过工资挺高的。{:10_256:} ~风介~ 发表于 2016-5-30 12:09
据说现在delphi的工作挺少的,不过工资挺高的。
我们公司开发的软件还有用delphi的,学习一下{:5_91:} lgd0722 发表于 2016-5-30 12:45
我们公司开发的软件还有用delphi的,学习一下
真是深藏不露啊!有钱途!{:9_232:}
页:
[1]