procedure TMainForm.Select(Index: Integer);
begin
Dialogs.Showmessage('you have selected '+SysUtils.IntToStr(Index));
end;
procedure TMainForm.Button1Click(Sender: TObject);
var
t: TCT1; {子窗体}
UserSelect: Integer;
begin
t := TCT1.Create(Self.Context);
try
if t.ShowModal=Business.Forms.Controls.mrOk then
begin
if t.RadioButton1.Checked then
UserSelect := 1
else if t.RadioButton2.Checked then
UserSelect := 2
else if t.RadioButton3.Checked then
UserSelect := 3
end;
finally
t.Free;
end;
case UserSelect of
1: Select(1);
2: Select(2);
3: Select(3);
end;
end;