성적 계산 프로그램 만드는 중인데요
모르는게 너무 많아서 힘드네요
아시는 분 좀 가르쳐주세요
goediting 해놓으면
입력한 점수가 stringgrid.cell[i,j]와 같나요??
그리고 초기화가 실제로 해보면 안돼네요..이건 왜 그런지..
또..문자키 같은거 스트링그리드에선 입력 안되게 어떻게 하나요..
이건 제 쏘스구요
한번 봐주세요 꼭 이요ㅜㅜ
unit ugrade;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids,Ugrade2;
type
Tfrmmain = class(TForm)
Button1: TButton;
Button2: TButton;
StringGrid1: TStringGrid;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmmain : Tfrmmain;
implementation
{$R *.DFM}
procedure Tfrmmain.Button1Click(Sender: TObject);
begin
frmrep.quickrep1.preview;
end;
procedure Tfrmmain.Button2Click(Sender: TObject);
begin
frmrep.quickrep1.print;
end;
procedure Tfrmmain.FormCreate(Sender: TObject);
var
test : Tfrmmain;
begin
test.StringGrid1.Cells[0,0] := '이름';
test.StringGrid1.Cells[1,0] := '수학';
test.StringGrid1.Cells[2,0] := '영어';
test.StringGrid1.Cells[3,0] := '총점';
test.StringGrid1.Cells[4,0] := '평균';
test.StringGrid1.Cells[0,1] := '철수';
test.StringGrid1.Cells[0,2] := '영희';
test.StringGrid1.Cells[0,3] := '총점';
test.StringGrid1.Cells[0,4] := '평균';
end;
procedure Tfrmmain.Button3Click(Sender: TObject);
var
test : Tfrmmain;
a,b,c,d:real;
begin
a:=strtofloat(test.StringGrid1.Cells[1,1]);
b:=strtofloat(test.StringGrid1.Cells[2,1]);
c:=strtofloat(test.StringGrid1.Cells[1,2]);
d:=strtofloat(test.StringGrid1.Cells[2,2]);
test.StringGrid1.Cells[3,1]:=floattostr(a+b);
test.StringGrid1.Cells[3,2]:=floattostr(c+d);
test.StringGrid1.Cells[4,1]:=floattostr((a+b)/2);
test.StringGrid1.Cells[4,2]:=floattostr((c+d)/2);
test.StringGrid1.Cells[1,3]:=floattostr(a+c);
test.StringGrid1.Cells[1,4]:=floattostr((a+c)/2);
test.StringGrid1.Cells[2,3]:=floattostr(b+d);
test.StringGrid1.Cells[2,4]:=floattostr((b+d)/2);
end;
end.