Now I want to know how I will short my code lines within one procudures just as sharing of events in only one procedures. for now I have written my program code like that but I want to learn how I will use events for 5 components within IF conditions. pls tell me how I will short these code line below. If you write to me or any sample like solution of below code scope I will be very glad from you..
procedure TAnaform.CheckBox2Click(Sender: TObject);
begin
if Checkbox2.Checked then
begin
Anaform.DIKEYAC2.Visible:=True;
Anaform.YATAYKAPA2.Visible:=False;
end;
if not (Checkbox2.Checked) then
begin
Anaform.DIKEYAC2.Visible:=False;
Anaform.YATAYKAPA2.Visible:=True;
end;
end;
procedure TAnaform.CheckBox3Click(Sender: TObject);
begin
if Checkbox3.Checked then
begin
Anaform.DIKEYAC3.Visible:=True;
Anaform.YATAYKAPA3.Visible:=False;
end;
if not (Checkbox3.Checked) then
begin
Anaform.DIKEYAC3.Visible:=False;
Anaform.YATAYKAPA3.Visible:=True;
end;
end;
procedure TAnaform.CheckBox4Click(Sender: TObject);
begin
if Checkbox4.Checked then
begin
Anaform.DIKEYAC4.Visible:=True;
Anaform.YATAYKAPA4.Visible:=False;
end;
if not (Checkbox4.Checked) then
begin
Anaform.DIKEYAC4.Visible:=False;
Anaform.YATAYKAPA4.Visible:=True;
end;
end;
procedure TAnaform.CheckBox5Click(Sender: TObject);
begin
if Checkbox5.Checked then
begin
Anaform.DIKEYAC5.Visible:=True;
Anaform.YATAYKAPA5.Visible:=False;
end;
if not (Checkbox5.Checked) then
begin
Anaform.DIKEYAC5.Visible:=False;
Anaform.YATAYKAPA5.Visible:=True;
end;
end;