unit SeleUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TSeleForm = class(TForm)
    Red: TRadioButton;
    Label1: TLabel;
    Yellow: TRadioButton;
    Blue: TRadioButton;
    BtnOK: TButton;
    BtnQuit: TButton;
    procedure BtnOKClick(Sender: TObject);
    procedure BtnQuitClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SeleForm: TSeleForm;

implementation
uses ShowUnit;
{$R *.dfm}

procedure TSeleForm.BtnOKClick(Sender: TObject);
  var ys:string;
begin
  if red.checked=true then
    ys:='红色'
  else if yellow.checked=true then
    ys:='黄色'
    else
      ys:='蓝色';
  ShowForm.label2.Caption:=ys;  //设置显示所选颜色的label2的标题
  ShowForm.showmodal;    //显示"显示颜色"窗体
end;

procedure TSeleForm.BtnQuitClick(Sender: TObject);
begin
  close;  //关闭"选择颜色"窗体
end;

end.
