for i:=0 to cxGBxgxx.ControlCount-1 do begin if (cxGBxgxx.Controls[i] is TcxRadioButton) and (TcxRadioButton(cxGBxgxx.Controls[i]).Caption :=trim(FieldValues['parent'])) then TcxRadioButton(cxGBxgxx.Controls[i]).Checked :=True; end;但那个caption处就是编不过去。
语法错误for i:=0 to cxGBxgxx.ControlCount-1 do begin if (cxGBxgxx.Controls[i] is TcxRadioButton) and (TcxRadioButton(cxGBxgxx.Controls[i]).Caption =trim(FieldValues['parent'])) then TcxRadioButton(cxGBxgxx.Controls[i]).Checked :=True; end;
2.也可以使用dbradiobuttion組件,指定其數據集和字段值
begin
if (cxGBxgxx.Controls[i] is TcxRadioButton) and (TcxRadioButton(cxGBxgxx.Controls[i]).Caption :=trim(FieldValues['parent'])) then
TcxRadioButton(cxGBxgxx.Controls[i]).Checked :=True;
end;但那个caption处就是编不过去。
begin
if (cxGBxgxx.Controls[i] is TcxRadioButton) and (TcxRadioButton(cxGBxgxx.Controls[i]).Caption =trim(FieldValues['parent'])) then
TcxRadioButton(cxGBxgxx.Controls[i]).Checked :=True;
end;