现有一程序(别人的程序无源码)为DELPHI编制,现想取得其中控件dxTreeList的内容,应该怎样做呢?

解决方案 »

  1.   

    要遍历dxTreeList是比较麻烦的,下面代码是取得选中的某行的数据.  if (dxTreeList.FocusedNode <> Nil) and
         (dxTreeList.FocusedNode.Parent <> Nil) then
      begin
        for i:=0 to dxTreeList.ColumnCount-1 do
        ShowMessage(dxTreeList.FocusedNode.Strings[i]);
      end;对于dxTreeList的操作一般是把dxTreeList的内容保存成一个文件,
    显示的时候再从文件里取出来.当然,你也可以把保存后的文件写入数据库中,
    读取的时候先从数据库里读出来存成文件,然后再load到dxTreeList中即可.var
      DataFile:string;
    begin
      DataFile := ExtractFilePath(Application.ExeName)+'\example.dat';
      if FileExists(DataFile) then 
         dxTreeList.LoadFromFile(DataFile);
    end;
      

  2.   

    你这是读自己程序的dxTreeList控件啊,我现在需要的是读别人程序里的txTreeList控件的数据啊