Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 29 Mar 2024, 14:01

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PropStorageEh
PostPosted: 21 Apr 2023, 08:55 
Offline

Joined: 25 Oct 2021, 10:49
Posts: 18
In a TDBGridEh I allow the user to move the columns and to modify their width. I use a PropStorageEh component to save the Columns information in the Registry with RegPropStorageManEh. Is there a way to delete the information saved in the Registry, if the user has made so many changes that he wants to start from scratch?


Top
 Profile  
 
 Post subject: Re: PropStorageEh
PostPosted: 26 Apr 2023, 09:57 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

One option is to delete the section manually.
Code:
   reg.DeleteKey(RegPropStorageManEh1.Path + '\' + PropStorageEh1.Section);

But after that, you need to cancel saving the settings
Code:
   PropStorageEh1.Active := False;
so that when the form is closed, the old settings are not saved in the registry again.
After that, you need to re-open the Form.

Code:
procedure TForm1.Button1Click(Sender: TObject);
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  reg.RootKey := RegPropStorageManEh1.Key;
  reg.DeleteKey(RegPropStorageManEh1.Path + '\' + PropStorageEh1.Section);
  reg.Free;
  PropStorageEh1.Active := False;
end;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group