System.Classes.TReader.OnSetName
Delphi
property OnSetName: TSetNameEvent read FOnSetName write FOnSetName;
C++
__property TSetNameEvent OnSetName = {read=FOnSetName, write=FOnSetName};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | public | System.Classes.pas System.Classes.hpp |
System.Classes | TReader |
Description
Occurs just before the reader object sets the Name property of a component it reads from its stream.
OnSetName is used internally by the IDE to handle duplicate names of components and forms. It can also be used to write an event handler to perform special processing just before the Name property is set for the component that has just been created and is about to have its properties read from the stream.
The Name parameter to the OnSetName event handler is passed by reference, so the handler can change the name before the reader assigns it to the component. For example, OnSetName is useful for filtering all the component names in a form, to add or change part of the string.
OnSetName is an event handler of type TSetNameEvent.