if shujiform=nil then
    shujiform:=Tshujiform.Create(application);
    if shujiform.ShowModal=mrok  then
    begin
     cxTreeList1.Clear;
      for a:=0 to shujiform.cxTreeList1.count-1 do  
(注:此句接收shujiform.cxTreeList1.count 的值,一直显示为0 )        begin
          cciD:=shujiform.cxTreeList1.Items[a].texts[0];
           adoquery1.Sql.clear;
           adoquery1.SQL.Add('select * from Ts_books where F_bookid=+'''+cciD+'''');
           adoquery1.Open;
           sjTreeListNode:=cxTreeList1.Add;
           sjTreeListNode.Values[0]:=adoquery1.FieldByName('F_bookid').AsString;
           sjTreeListNode.Values[1]:=adoquery1.FieldByName('F_namef').AsString;
           sjTreeListNode.Values[2]:=adoquery1.FieldByName('F_sl').AsString;
           sjTreeListNode.Values[3]:=adoquery1.FieldByName('F_author').AsString;
           sjTreeListNode.Values[4]:=adoquery1.FieldByName('F_cbs').AsString;
        end;
      shujiform.Close;
      shujiform.free;
      shujiform:=nil;
    end;
该如何才能获取shujiform.cxTreeList1.count 的值?

解决方案 »

  1.   

    cxTreeList1.Clear;
          for a:=0 to shujiform.cxTreeList1.count-1 do  
    (注:此句接收shujiform.cxTreeList1.count 的值,一直显示为0 )
    cxTreelist1和shujiform.cxTreeList1.count是一个窗体上的吗?
    shujiform.cxTreeList1 有增加数据吗?
      

  2.   

    不是一个窗体,是调用的shujiform
      

  3.   

    shujiform.cxTreeList1有数据。
      

  4.   

    cxTreeList1.Clear;//你把所有的内容都清,你说不为零为什么?
    //测试
    //cxTreeList1.Item.add('123')
          for a:=0 to shujiform.cxTreeList1.count-1 do  
    (注:此句接收shujiform.cxTreeList1.count 的值,一直显示为0 )
      

  5.   

    cxTreeList1与shujiform.cxTreeList1不是同一个啊。
      

  6.   

    cxTreeList1.Clear;//你把所有的内容都清,你说不为零为什么?
    //测试
    //shujiform.cxTreeList1.Clear
    //shujiform.cxTreeList1.Item.add('123')
    //shujiform.cxTreeList1.Item.add('456')
          for a:=0 to shujiform.cxTreeList1.count-1 do  
      

  7.   

    cxTreeList1与shujiform.cxTreeList1j 是不同窗体中的。
      

  8.   

    应该是shujiform.cxTreeList1
    里面没有值,所以当然为空你手工添加一些看结果怎么样?