Setting Field Component Properties at Runtime

From RAD Studio
Jump to: navigation, search

Go Up to Setting Persistent Field Properties and Events


You can use and manipulate the properties of field component at run time. Access persistent field components by name, where the name can be obtained by concatenating the field name to the dataset name.

For example, the following code sets the ReadOnly property for the CityStateZip field in the Customers table to True:

CustomersCityStateZip.ReadOnly := True;
CustomersCityStateZip->ReadOnly = true;

And this statement changes field ordering by setting the Index property of the CityStateZip field in the Customers table to 3:

CustomersCityStateZip.Index := 3;
CustomersCityStateZip->Index = 3;

See Also