I have the following radio group which reacts to a BitBtn.
I would prefer to replace the BitBtn with (perhaps) a
re-iterating procedure. Whereby mere selection of a
radio button has the desired effect.
Other than replacing the Radio Buttons with buttons, along with an eventhandler for each, I can't find how to do this.
Can someone please make a suggestion?
procedure TfrmRegister.BitBtn1Click(Sender: TObject);
begin
with RadioGroup1, Items do
begin
if Strings[ItemIndex] = 'Option1' then
begin
Panel2.Visible := False;
Panel3.Visible := False;
Panel1.Visible := True;
end;
if Strings[ItemIndex] = 'Option2 then
begin
Panel1.Visible := False;
Panel3.Visible := False;
Panel2.Visible := True;
end;
if Strings[ItemIndex] = 'Option3 then
begin
Panel1.Visible := False;
Panel2.Visible := False;
Panel3.Visible := True;
end;
end;
end;
I would prefer to replace the BitBtn with (perhaps) a
re-iterating procedure. Whereby mere selection of a
radio button has the desired effect.
Other than replacing the Radio Buttons with buttons, along with an eventhandler for each, I can't find how to do this.
Can someone please make a suggestion?
procedure TfrmRegister.BitBtn1Click(Sender: TObject);
begin
with RadioGroup1, Items do
begin
if Strings[ItemIndex] = 'Option1' then
begin
Panel2.Visible := False;
Panel3.Visible := False;
Panel1.Visible := True;
end;
if Strings[ItemIndex] = 'Option2 then
begin
Panel1.Visible := False;
Panel3.Visible := False;
Panel2.Visible := True;
end;
if Strings[ItemIndex] = 'Option3 then
begin
Panel1.Visible := False;
Panel2.Visible := False;
Panel3.Visible := True;
end;
end;
end;