其他分享
首页 > 其他分享> > cxGrid布局的保存和恢复

cxGrid布局的保存和恢复

作者:互联网

//恢复布局
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); //保存为布局文件

 

https://www.cnblogs.com/hnxxcxg/archive/2010/05/24/2940716.html

标签:cxGrid,Layout,ExeName,Self,布局,保存,tvResult,IniFileName
来源: https://www.cnblogs.com/usegear/p/11255102.html