12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

468 Day 12<br />

You can toggle a database field’s visibility <strong>in</strong> a grid, determ<strong>in</strong>e what its valid values are, and<br />

control whether it can be changed—all us<strong>in</strong>g the TField component.<br />

Table 12.24 lists the key properties, Table 12.25 lists the key methods, and Table 12.26 lists<br />

the key events for TField.<br />

Table 12.24. TField key properties.<br />

Property Description<br />

Calculated Reflects whether a field is a calculated field.<br />

TDataset Returns the TDataset to which this TField belongs.<br />

EditMask Specifies an <strong>in</strong>put mask that limits text typed <strong>in</strong>to the control.<br />

FieldName Specifies the associated database field name.<br />

Lookup Reflects whether a field is a lookup field.<br />

Value Returns the TField’s underly<strong>in</strong>g data value as a variant.<br />

Visible Determ<strong>in</strong>es whether the TField is visible (by default) <strong>in</strong> DBGrid<br />

controls.<br />

Table 12.25. TField key methods.<br />

Method Function<br />

Assign Copies the value <strong>in</strong> one field to another.<br />

AssignValue Assigns a literal value to a TField.<br />

Clear Empties a TField.<br />

GetData Returns the data from a field <strong>in</strong> raw format.<br />

SetData Assigns raw data to a field.<br />

Table 12.26. TField key events.<br />

Event Catalyst<br />

OnChange Occurs when any modification is made to a TField.<br />

OnValidate Occurs when a field’s value is changed.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!