Results 1 to 2 of 2

Thread: How to group TRadioButtons together

  1. #1
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to group TRadioButtons together

    So how can I have "groups" of TRadioButtons with the following script you can only have one checked.
    SCAR Code:
    program FormDesign;
    type
      TestType = array[0..3]of TRadioButton;
    var
      Form: Tform;
      TestVar: array[0..2]of TestType;
      i, ii: integer;
      trbCaption: TStringArray;
     
    procedure InitForm;
    begin
      Form := CreateForm;
      for i := 0 to 2 do
      for ii := 0 to 3 do
        TestVar[i][ii] := TRadioButton.create(Form);
      with Form do
      begin
        Left := 100;
        Top := 100;
        Width := 500;
        Height := 500;
        Caption := 'New Form';
        Color := clWhite;
        Font.Color := clBlack;
      end;
      trbCaption := ['A)', 'B)', 'C)'];
      for i := 0 to 2 do
      for ii := 0 to 3 do
      begin
        with TestVar[i][ii] do
        begin
          Parent := Form;
          Top := 10 + ( ii * 20 );
          Left := 10 + ( i * 30 );
          Caption := trbCaption[i];
        end;
      end;
    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      Form.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    begin
      SafeInitForm;
      SafeShowFormModal;
    end.

  2. #2
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've got a form with three TRadios on it, and I want to be able to select them all, help us .

    Free bump, I guess.

    ~Sand

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •