动态生成checkbox控件,如何才能控制单选

解决方案 »

  1.   

    为什么不用RadioButton,如果要控制CheckBox单选就得自己写代码了。
    procedure TForm1.ClearCheckBox
    begin
      CheckBox1.Check := false;
      CheckBox1.Check := false;
    endprocedure TForm1.CheckBox1Click(Sender : TObject)
    begin
      ClearCheckBox;
      CheckBox1.Check := True;
    end;
      

  2.   

    checkbox控件数是不定的,我用的是数组,不知如何控制多个控件的单选,类似radiobutton
      

  3.   

    var
      a: TCheckBox;
    begin
      a := TCheckBox.Create(form1);
      a.Caption := 'test';
      a.Checked := true;
      a.parent := form1;