تمرين بسيط في الدالفي

Share:
مساء الخير

اضع لكل مبتدا هذا التمرين

موضوعه كيف نضع زرا يقوم بعد الكليك أي أن كلما ضغطنا على الزر العداد يحسب وأتمنى ان تجربوه  
في البداية نفتح دالفي و ننشأ  form1 و ضع  button1 و 2 button 
le button1 c'est un compteur 
le button2 le remise a zero 
caption de button1: 0                                                                                       

الكود

procedure TForm1.Button1Click(Sender: TObject);
var c:integer;
    m:integer;
begin
  c:=0;
  m:=1;
  c:=strtoint(button1.caption);
       button1.caption:=inttostr(c+1);
    m:=m+c;
  m:=strtoint(button1.caption);
button1.caption:=inttostr(m+1);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
button1.Caption :='0';
end;

end.