//恢复布局   
 IniFileName   :=   ExtractFilePath(Application.ExeName)   +   'Layout\'   +   Self.Name  +   '.ini';   
 if   FileExists(IniFileName)   
then   
     Self.tvResult.RestoreFromIniFile(IniFileName) //从布局文件中恢复
  else   
  begin   
      Self.tvResult.BeginUpdate;   
      for   i   :=   0   to   Self.tvResult.ItemCount   -   1   do   
          Self.tvResult.Items[i].ApplyBestFit; //调整为最佳宽度   
      Self.tvResult.EndUpdate;   
 end;   
    
  //保存布局   
IniFileName := ExtractFilePath(Application.ExeName) + 'Layout\' + Self.Name + '.ini';  
 if   not   DirectoryExists(ExtractFileDir(IniFileName))   then   
      CreateDir(ExtractFileDir(IniFileName));   
Self.tvResult.StoreToIniFile(IniFileName); //保存为布局文件

posted on 2011-03-27 23:47  fyen  阅读(492)  评论(0编辑  收藏  举报