Home > Back-end >  TStringList Updating of a class attribute, the OnChanging event and associated with the string list
TStringList Updating of a class attribute, the OnChanging event and associated with the string list

Time:10-25

Updating bool is being updated list of strings, read-only property,
When change TStrings attribute values, will be update the status, Updating attribute to true, the update is complete, Updating to false,
Can call BeginUpdate method for Updating to true, tell the relevant code in the string list updates, call EndUpdate method for Updating to false, BeginUpdate and EndUpdate must come in pairs, EndUpdate and EndUpdate columns, false state Updating, BeginUpdate and EndUpdate internal counter to UpdateCount attribute, is protected access,
If you want to update the string list, Memo Lines attributes, for example, first call BeginUpdate make Updating attribute is true, can prevent the refresh in the process of repeatedly updated, when the update is completed, call EndUpdate tell string list update completed, internal counter to zero and Updating attribute to false, will refresh,

OnChanging TNotifyEvent when to add, delete, move, modify, this event can be generated
Whether or not between the BeginUpdate and EndUpdate operations, or Updating the status, this event can be generated
Control and related to the string list, control can stop the refresh when this event is generated, because the string list now began to update the content, wait until the OnChange event, have finished the work by updating,
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Is to modify a string, Updating to true, trigger OnChanging event, associated controls to stop the refresh,
Modified, Updating to false, trigger OnChage events, associated controls can refresh?
BeginUpdate Updating will be set to true, the trigger OnChanging event, associated controls to stop the refresh?
But why say again:
Whether or not between the BeginUpdate and EndUpdate operations, or Updating the status, will produce (OnChanging) the incident,
Is trigger OnChanging event before Updating to true in the back?

CodePudding user response:

BeginUpdate void __fastcall BeginUpdate (void);
Began to update, when the string list has been modified, will automatically call, please refer to the Updating attributes,
  • Related