Puh maafnih nubie ini mau nanyaa koo applikasi ane ga jalan yah malah masuknya ke baris pertama
Code:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
StringGrid1: TStringGrid;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Y : integer;
E : integer;
I : integer;
Q : integer;
P : integer;
C : integer;
V : integer;
M : integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
stringgrid1.Cells[0,Y]:=inttostr(Y);
stringgrid1.Cells[1,E]:=edit1.Text;
stringgrid1.Cells[2,I]:=edit2.Text;
stringgrid1.Cells[3,Q]:=edit3.Text;
stringgrid1.Cells[4,P]:=edit4.Text;
stringgrid1.Cells[4,C]:=edit5.Text;
stringgrid1.Cells[4,I]:=Floattostr(Q+P+C);
stringgrid1.Cells[4,M]:=Floattostr(I/3);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
stringgrid1.ColCount:=9;
stringgrid1.ColWidths[0]:=30;
stringgrid1.ColWidths[1]:=30;
stringgrid1.ColWidths[2]:=50;
stringgrid1.ColWidths[3]:=80;
stringgrid1.ColWidths[5]:=90;
stringgrid1.ColWidths[6]:=90;
stringgrid1.ColWidths[7]:=90;
stringgrid1.ColWidths[8]:=90;
stringgrid1.Cells[0,0]:='No';
stringgrid1.Cells[1,0]:='Nim';
stringgrid1.Cells[2,0]:='Nama';
stringgrid1.Cells[3,0]:='UTS';
stringgrid1.Cells[4,0]:='UAS';
stringgrid1.Cells[5,0]:='Tugas';
stringgrid1.Cells[6,0]:='Total';
stringgrid1.Cells[7,0]:='Nilai';
end;
end.