//存储Grid格式ini function SaveGridIni(ADBGridEhNameStr: string;ADBGridEh:TDBGridEh): Boolean; var IniFileNameStr:string; begin IniFileNameStr := ExtractFileDir(ParamStr(0)) + '\' + 'DBGirdConfig.ini'; ADBGridEh.SaveGridLayoutIni(IniFileNameStr,ADBGridEhNameStr,False); end; //加载读取Grid格式ini function RestoreGridIni(ADBGridEhNameStr: string;ADBGridEh:TDBGridEh): Boolean; var IniFileNameStr:string; RestoreParams: TDBGridEhRestoreParams; begin IniFileNameStr := ExtractFileDir(ParamStr(0)) + '\' + 'DBGirdConfig.ini'; ADBGridEh.RestoreGridLayoutIni(IniFileNameStr,ADBGridEhNameStr,RestoreParams); end;
procedure TForm1.Button1Click(Sender: TObject); begin DBGridEh1.SaveGridLayoutIni('C:\DBGridEh.ini',DBGridEh1.ClassName,True); end; procedure TForm1.FormCreate(Sender: TObject); var MyRestoreParams :TDBGridEhRestoreParams; begin MyRestoreParams :=[grpColIndexEh,grpColWidthsEh,grpSortMarkerEh,grpColVisibleEh,grpRowHeightEh];
DBGridEh1.RestoreGridLayoutIni('C:\DBGridEh.ini',DBGridEh1.ClassName,MyRestoreParams); end;
本文来自博客园,作者:del88,转载请注明原文链接:https://www.cnblogs.com/del88/archive/2013/04/07/3006358.html