不会用呀...
就是比如有几个Items..
选中第一项作...
选中第二项作....
两项一起选作.......
三项一起选作.............

解决方案 »

  1.   

    用CheckListBox1.Checked[n]来判断某项是否选中。
    比如:
    procedure TForm1.CheckListBox1Click(Sender: TObject);
    begin
      if CheckListBox1.Checked[CheckListBox1.ItemIndex] = True then
      begin
        ShowMessage('当前项为被选中状态');
      end;
    end;
      

  2.   

    啊...我还没说明白呀?
    这样说吧..
    有2个Items.分别为a,b.
    单选A时候DO 事件1;
    单选B时候DO 事件2;
    同时选A,B时候DO 事件3;而且我的事件代码应该是写在Buttonclick里..不是CheckListBox1Click
    这样说明白么??
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      if (CheckListBox1.Checked[CheckListBox1.Items.IndexOf('a')]) and
          (not CheckListBox1.Checked[CheckListBox1.Items.IndexOf('b')]) then
      begin
        ShowMessage('a Checked');
      end;
      if (not CheckListBox1.Checked[CheckListBox1.Items.IndexOf('a')])and
         (CheckListBox1.Checked[CheckListBox1.Items.IndexOf('b')]) then
      begin
        ShowMessage('b Checked');
      end;
      if (CheckListBox1.Checked[CheckListBox1.Items.IndexOf('a')])and
         (CheckListBox1.Checked[CheckListBox1.Items.IndexOf('b')]) then
      begin
        ShowMessage('a、b Checked');
      end;
    end;
      

  4.   

    if form1.CheckListBox1.Checked[1] and form1.CheckListBox1.Checked[2] then
       showmessage('你选中了第2和第3项');
      

  5.   

    Kevin_Lmx(繁华阅尽)
    你可真快手啊!.....^_^
      

  6.   

    我好晕哪,呵呵。
    gxgyj(杰克.逊)别来无恙?
    ^_^
      

  7.   

    case CheckListBox1.Checked of 
    true:do something ....
    end;
    case CheckListBox2.Checked of
    true:do something ....
    end;
      

  8.   

    这样吧
    procedure TForm1.CheckListBox1Click(Sender: TObject);
    var
      I : Integer;
      str: String;
    begin
      for I:=0 to CheckListBox1.Items.Count-1 do
      begin
        if CheckListBox1.Checked[I] then
          Str := Str + CheckListBox1.Items.Strings[I];
      end;
      if Str='a' then
      begin
        ......
      end
      if Str='b' then
      begin
        ......
      end
      if Str='ab' then
      begin
        ......
      end
      if str=.......
    end;
      

  9.   

    这样说吧..
    比如有3个Items.分别为a,b.c
    单选A时候 DO 事件1;
    单选B时候 DO 事件2;
    同时选A,B时候 DO 事件3;
    同时选A,C时候 DO 事件4;
    同时选A,B,C时候 DO 事件5;Items少的时候还好...我现在是五项就已经有够多可能了..再多怎么办呀??
    一定要先全列出所有可能性么??
      

  10.   

    就算是3个ITEM..也有七种可能性呢..哎...
      

  11.   

    就拿A.B.C.D.E模拟不行么??
    我实际就是5种图表..
    客户选了几个我就在DBChart上画出那几个图表来...
      

  12.   

    我有点不解:
    如:单选A就执行事件A
       单选B就执行事件B...
    那么选择A和B不就是先执行事件A再执行事件B就可以了吗?难道这时是执行事件C吗?
      

  13.   

    哎..还是没明白诶..
    选择A和B我不是要作A.B两件事情.
    而是作另外的第三件事情..