Hallo Christoph,
mal so richig Q&D:
Delphi-Quellcode:
PROCEDURE TForm1.Button2Click(Sender: TObject);
PROCEDURE DisableRGItems(comp: TComponent; rg: TRadioGroup);
VAR
k, i : integer;
a : Tcomponent;
BEGIN
FOR k := 0 TO comp.ComponentCount - 1 DO
BEGIN
a := comp.components[k];
IF a.classType = TRadioGroup THEN
WITH (a AS TRadioGroup) DO
IF rg.Name = a.Name THEN
FOR i := 0 TO Items.Count - 1 DO
IF ItemIndex <> i THEN
Controls[i].Enabled := false;
END;
END;
BEGIN
// 1. Parameter ist die Form, 2. Die Radiogroup
DisableRGItems(self, RadioGroup1);
END;
p.s. Wenn kein Item angewählt ist, werden alle Disabled