Man_Without_Face
Я так у себя это делал
Код:
TForm1 = class(TForm)
cxCheckGroup1: TcxCheckGroup;
procedure cxCheckGroup1PropertiesEditValueChanged(Sender: TObject);
private
{ Private declarations }
fPriorState: TcxCheckStates;
public
{ Public declarations }
function CheckedCount(aCheckGroup: TcxCheckGroup): Integer;
end;
function TForm1.CheckedCount(aCheckGroup: TcxCheckGroup): Integer;
var
i: Integer;
begin
Result := 0;
for i := 0 to aCheckGroup.Properties.Items.Count - 1 do
if aCheckGroup.States[i] = cbsChecked then
begin
inc(Result);
end
end;
procedure TForm1.cxCheckGroup1PropertiesEditValueChanged(Sender: TObject);
begin
if CheckedCount(cxCheckGroup1) > 3 then
cxCheckGroup1.EditValue := CalculateCheckStatesValue(fPriorState, cxCheckGroup1.Properties.Items, cvfIndices)
else
CalculateCheckStates(cxCheckGroup1.EditValue, cxCheckGroup1.Properties.Items, cvfIndices, fPriorState);
end;