使用界面如下图。
属性
AtLeast1Sel 至少有1项处于选择状态,即最后一个选择项不能取消。
CheckType 选项类型。“0”为复选框,“1”为按钮。
Cols 列数。“0”时按照Items内文字格式排列。
ColWidth 列宽度
Dir 排列方向。“0”为横排,Cols属性有效;“1”为竖排,Rows属性有效
Items 选项名称。
MultiSel 复选开关。设为“False”时行为与TRadioButton相同
RowHeight 行高
Rows 行数。
SelIndex “-1”取消全部选择,“0”选择第一个
TextLeft 文字在选择框的左边/右边
函数
设置选择状态
procedure SetChecked(s:ansistring);
设置多个选项选择状态为true。s格式为“0,1,2,3”。在MultiSel=trues时,未指定的选项状态不受影响。
procedure SetChecked(ind:integer);
设置第ind个选项选择状态为true
procedure SetChecked(col,row:integer; b:boolean);
设置第col列第row行选项选择状态为b。
获取选择状态
function SelStr:ansistring;
返回已经选择的选项的序号,格式为“0,1,2,3”。
function checked(ind:integer):boolean;
返回第ind个选项的状态
function checked(col,row:integer):boolean;
返回第col列第row行选项的选择状态。