La première fois que je suis allé à Delphi, je me sentais plutôt bien, mais mon anglais était trop mauvais et je n'ai pas reconnu beaucoup de contrôles à l'intérieur.
Lorsque j'ai commencé à aller sur l'ordinateur, j'ai écrit un programme aléatoire qui pourrait modifier la couleur d'arrière-plan de la forme.
unité unité 1;
interface
usages
Windows, messages, systèmes, variantes, classes, graphiques, contrôles, formulaires,
Dialogues, stdctrls;
taper
Tform1 = classe (tform)
Button1: Tbutton;
Button2: TBUTTON;
Button4: Tbutton;
Button5: Tbutton;
Button6: Tbutton;
Button3: Tbutton;
Procédure Button1Click (expéditeur: tobject);
Procédure Button2Click (expéditeur: tobject);
Procédure Button4Click (expéditeur: tobject);
Procédure Button5Click (expéditeur: tobject);
Procédure Button6Click (expéditeur: tobject);
Procédure Button3Click (expéditeur: tobject);
Privé
{Déclarations privées}
publique
{Déclarations publiques}
fin;
var
FORM1: TFORM1;
Mise en œuvre
{$ R * .dfm}
Procédure tform1.button1Click (expéditeur: tobject);
Commencer
Form1.Caption: = 'Red Background';
Form1.Color: = Clire // La couleur de la forme est modifiée
fin;
Procédure tform1.button2click (expéditeur: tobject);
Commencer
form1.caption: = 'fond blanc';
form1.color: = clwhite
fin;
Procédure tform1.button4click (expéditeur: tobject);
Commencer
form1.caption: = 'Blee Background';
form1.color: = clblue
fin;
Procédure tform1.button5click (expéditeur: tobject);
Commencer
form1.caption: = 'fond jaune';
form1.color: = Clyellow
fin;
Procédure tform1.button6click (expéditeur: tobject);
Commencer
form1.caption: = 'Background vert';
form1.color: = clgreen
fin;
Procédure TForm1.Button3Click (expéditeur: tobject);
Commencer
form1.close
fin;
fin.
J'étais très heureux d'écrire un petit code avec lui pour la première fois.