用AdvStringGrid。<br>1、AddCheckBoxToColOfGrid(grdCheck, [0]);<br>procedure AddCheckBoxToColOfGrid(AdvStringGrid: TAdvStringGrid; ACols: Array of Integer);<br>var<br> i, ARow: Integer;<br>begin<br> with AdvStringGrid do<br> for ARow := 1 to RowCount - 1 do<br> begin<br> for i := Low(ACols) to High(ACols) do<br> if Cells[ACols,ARow] = '1' then<br> begin<br> AddCheckBox(ACols, ARow ,True, False);<br> Cells[ACols,ARow] := '' ;<br> end else<br> begin<br> AddCheckBox(ACols, ARow ,False, False);<br> Cells[ACols,ARow] := '' ;<br> end;<br> end;<br>end;<br>2、双击事件<br>procedure TfrmConAndDev_Check.grdCheckDblClickCell(Sender: TObject; ARow,<br> ACol: Integer);<br>begin<br> if (ARow > 0) and (Cells[1, 1] <> '') then<br> begin<br> ToggleCheckBox(0, ARow);<br> GetSelectedInfo;<br> end;<br>end;<br>3、procedure TfrmConAndDev_Check.GetSelectedInfo;<br>var<br> i: Integer;<br> SelCount: Integer;<br> AStatue: Boolean;<br>begin<br> for i := 1 to grdCheck.RowCount - 1 do<br> begin<br> grdCheck.GetCheckBoxState(0, i, AStatue);<br> if AStatue then<br> begin<br> Inc(SelCount);<br> ...<br> end;<br> end;<br>end;