DBGRIDEH格式保存/恢复
procedure TFrmColSelect.SaveGridLayOut;
var
Ini: TIniFile;
begin
if CheckBox1.Checked then
Grid.SaveGridLayoutIni(ExtractFilePath(Application.ExeName) + '/Grid.ini',
Owner.ClassName + '$' + Name, true)
else
begin
Ini := TIniFile.Create(ExtractFilePath(Application.ExeName) + '/Grid.ini');
try
Ini.EraseSection(Grid.Owner.ClassName + '$' + Grid.Name);
finally
Ini.Free;
end;
end;
end;
procedure RestoreGridLayOut(AGrid:TDBGridEh);
var
RestoreParams:TDBGridEhRestoreParams;
begin
RestoreParams:=[grpColIndexEh,grpColWidthsEh,grpSortMarkerEh,
grpColVisibleEh,grpRowHeightEh];
with AGrid do
RestoreGridLayoutIni(ExtractFilePath(Application.ExeName) + '/Grid.ini',
Owner.ClassName + '$' + Name,RestoreParams);
end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/archive/2008/04/15/2940886.html