标签: tchecklistbox

我如何在TCheckListBox上使用多个列?

我正在使用TcheckListBox控件,并希望在此使用第二列,但除了Columns和Header属性之外,我找不到插入多列内容的任何来源...

它看起来像一个noobie问题,但Delphi的帮助没有任何关于此的内容,我的搜索(在Google和SO上)带来了很多垃圾......

我只需要一个例子.

delphi tchecklistbox

10
推荐指数
2
解决办法
9083
查看次数

如何使TCheckListBox垂直滚动?

我在表单上有一个TCheckListBox.它的Columns属性设置为2,如果有多个项目可以放在屏幕上的两列中,它会在控件底部放置一个水平滚动条.

事实上,这种形式的布局,垂直滚动会更方便.但我似乎无法弄清楚如何让盒子做到这一点.我认为将Columns设置为1应该可以工作,但事实并非如此.

任何人都知道如何使TCheckListBox垂直滚动而不是水平滚动?

delphi delphi-2010 tchecklistbox

4
推荐指数
1
解决办法
2038
查看次数

在Delphi上限制TCheckListBox的检查项

我想限制一个TCheckListBox.我希望只检查2个项目,并且所有未检查的项目将被禁用并变灰.由于已选中/未选中的项目是动态的,因此我无法使用静态itemIndex.

这是我尝试过的,但我得到了"超出芯片范围"的错误.

在我的CheckListBox的click事件上;

var
  NumberOfCheckedItems, I: Integer;
begin
  NumberOfCheckedItems := 0;
  for I := 0 to CkLst1.Count - 1 do
  begin
    if CkLst1.Checked[I] then
      NumberOfCheckedItems := NumberOfCheckedItems + 1;
  end;
  if NumberOfCheckedItems > 1 then
  begin
    CkLst1.Checked[I] := Enabled;
    CkLst1.Enabled := FALSE;
    CkLst1.AllowGrayed := TRUE;
  end
  else
  begin
    //no idea
  end;
end;
Run Code Online (Sandbox Code Playgroud)

delphi tchecklistbox delphi-xe checklistbox

3
推荐指数
1
解决办法
2785
查看次数

TCheckListBox获取计数检查项

我有一个简单的问题。如何在不使用循环的情况下获取CheckBoxListBox中已检查项目的计数?

c++builder tchecklistbox c++builder-xe5

2
推荐指数
1
解决办法
718
查看次数