1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| unit Listeeleves;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TListe = class(TForm)
Ajouteleve: TButton;
Button2: TButton;
Ajout: TGroupBox;
Nomeleve: TLabel;
Champnom: TEdit;
Prenom: TLabel;
Champprenom: TEdit;
Valid: TButton;
Edit1: TEdit;
Listingclasse: TStringGrid;
procedure AjouteleveClick(Sender: TObject);
procedure ValidClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Liste: TListe;
identite : string;
colonne : integer;
ligne : integer;
implementation
{$R *.dfm}
procedure TListe.FormCreate(Sender: TObject);
begin
ligne := 0 ;
colonne :=0 ;
Listingclasse.Cells [0,0] := 'Nom';
Listingclasse.Cells [1,0] := 'Prénom';
end;
procedure TListe.AjouteleveClick(Sender: TObject);
begin
ajout.Visible := true;
end;
procedure TListe.ValidClick(Sender: TObject);
begin
with Listingclasse do
Listingclasse.Cells[colonne,ligne+1]:= champnom.text;
Listingclasse.Cells[colonne+1,ligne+1]:= champprenom.text;
end;
end. |
Partager