RAD Studio VCL Reference
|
Returns the component with the name passed as a parameter.
function GetComponent(const Name: string): TComponent;
__fastcall TComponent * GetComponent(const AnsiString Name);
Call GetComponent to access a component given its name. If the component is not in the current root object, the Name parameter should include the name of the entity in which it resides. For example, to obtain a reference to a component in a data module named 'DataModule2', use a line such as
TheComponent := Designer.GetComponent('DataModule2.Button1'); {Delphi}
TheComponent = Designer->GetComponent("DataModule2->Button1"); // C++
If DataModule2's unit is in the uses clause of the current root object (Delphi) or its header is included by the root object's unit (C++), GetComponent returns the component.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|