lundi 6 juillet 2015

Showing multiple checkbox, delphi

I have 6 checkbox with edittext at each of checkbox. I want to show only the selected checkbox with its edittext value in memo. Here is my code:

//jumCheck is total of selected checkbox
for I := 0 to jumCheck - 1 do
begin
 if CheckBox1.Checked then
 begin
   Memo1.Lines.Append('Gejala: '+CheckBox1.Caption+', Penyakit: '+Edit1.Text);
 end
 else if CheckBox2.Checked then
 begin
   Memo1.Lines.Append('Gejala: '+CheckBox2.Caption+', Penyakit: '+Edit2.Text);
 end;
end;

And the result is just the first checkbox that i was selected for looping.

Anyone, please help me.




Aucun commentaire:

Enregistrer un commentaire