procedure TForm1.FormCreate(Sender: TObject);
begin
StringGrid1.Cells[0,0]:='코드' ;
StringGrid1.Cells[1,0]:='학과' ;
StringGrid1.Cells[2,0]:='학번' ;
StringGrid1.Cells[3,0]:='이름' ;
StringGrid1.Cells[4,0]:='국어점수';
StringGrid1.Cells[5,0]:='영어점수';
StringGrid1.Cells[6,0]:='점수합계';
StringGrid1.Cells[7,0]:='점수평균';
StringGrid1.Cells[8,0]:='성별' ;
StringGrid1.Cells[9,0]:='번호' ;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
cnt : integer;
s : String;
begin
cnt := 1;
s:=' ';
if ComboBox1.Text = '전자공학과' then
StringGrid1.Cells[0, cnt] := '01';
if ComboBox1.Text = '전기공학과' then
StringGrid1.Cells[0, cnt] := '02';
if ComboBox1.Text = '컴퓨터공학과' then
StringGrid1.Cells[0, cnt] := '03';
StringGrid1.Cells[1, cnt] := ComboBox1.Text;
StringGrid1.Cells[2, cnt] := Edit1.Text;
StringGrid1.Cells[3, cnt] := Edit2.Text;
if RadioGroup1.ItemIndex = 0 then
StringGrid1.Cells[4, cnt] := '남자';
if RadioGroup1.ItemIndex = 1 then
StringGrid1.Cells[4, cnt] := '여자';
StringGrid1.Cells[5, cnt] := Edit3.Text;
StringGrid1.Cells[6, cnt] := Edit4.Text;
StringGrid1.Cells[7, cnt] := intTostr(StrToint(Edit3.Text)+(StrToint(Edit4.Text)));
StringGrid1.Cells[8, cnt] := FloatTostr(StrToint(StringGrid1.Cells[7, cnt]) / 2 );
if CheckBox1.Checked = true then
S := S + '1'
else
S := S + '0';
if CheckBox2.Checked = true then
S := S + '1'
else
S := S + '0';
if CheckBox3.Checked = true then
S := S + '1'
else
S := S + '0';
if CheckBox4.Checked = true then
S := S + '1'
else
S := S + '0';
if CheckBox5.Checked = true then
S := S + '1'
else
S := S + '0';
StringGrid1.Cells[9, cnt] := s;
inc(cnt);
end;
end.
소스를 짯는데;
한칸씩 내려가지를 않습니다 ㅠㅠ
뭐가 잘못된건지좀 가르쳐 주세요 ㅠㅠ
|