在RadioGroup 中有若干个选项,
我在RadioGroup Click事件中,想实现哪个被选中时马上改变颜色
请大家指点

解决方案 »

  1.   

    是被选中的那个选项的字体改变,我试了一下结果所有的items的字都改变了:(
      

  2.   

    procedure tform1.aa;
    var
    i:integer;
    s:string;
    begin
    for i := 0 to self.componentcount-1 do
    if self.components[i] is TradioButton then
      if (self.components[i] as TradioButton).checked then
        begin
           (self.components[i] as TradioButton).Color :=clskyblue;
        end
        else
           (self.components[i] as TradioButton).Color :=clBtnFace;
    end;
    请别忘记声明,使用时,在每个TradioButton的click事件中调用这个过程就行了
    最后也别忘记给俺工钱啊:)