procedure ToggleTreeViewCheckBoxes( Node :TTreeNode; cUnChecked, //CheckBox未选中状态 cChecked, //CheckBox选中状态 cRadioUnchecked, //RadioButtion未选中状态 cRadioChecked :integer); // RadioButtion选中状态 var tmp:TTreeNode; begin if Assigned(Node) then begin //如果当前是未选中状态则变为选中状态 if Node.StateIndex = cUnChecked then Node.StateIndex := cChecked //如果当前是选中状态则变为未选中状态 else if Node.StateIndex = cChecked then Node.StateIndex := cUnChecked else if Node.StateIndex = cRadioUnChecked then begin tmp := Node.Parent; if not Assigned(tmp) then tmp := TTreeView(Node.TreeView).Items.getFirstNode else tmp := tmp.getFirstChild; while Assigned(tmp) do begin if (tmp.StateIndex in [cRadioUnChecked,cRadioChecked]) then tmp.StateIndex := cRadioUnChecked; tmp := tmp.getNextSibling; end; Node.StateIndex := cRadioChecked; end; // if StateIndex = cRadioUnChecked end; // if Assigned(Node) end; |
欢迎访问最专业的网吧论坛,无盘论坛,网吧经营,网咖管理,网吧专业论坛
https://bbs.txwb.com
关注天下网吧微信/下载天下网吧APP/天下网吧小程序,一起来超精彩
|