RAD Studio VCL Reference
TReader.OnSetName Event

Occurs just before the reader object sets the Name property of a component it reads from its stream.

property OnSetName: TSetNameEvent;
__property TSetNameEvent OnSetName;

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 which has just been created and is about to have its properties read from the stream. 

The Name parameter to the OnSetName event handler 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. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!