TTIPropertyGrid

From Lazarus wiki
Revision as of 12:19, 4 October 2020 by Wp (talk | contribs) (Create page on TIPropertyGrid)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

TIPropertyGrid belongs to the group of RTTI Controls. It acts like the object inspector in the Lazarus IDE:

  • Simply drop it onto a form, maybe align it to the left side of the form (TIPropertyGrid1.Align := alLeft).
  • In property TIObject, select the name of the control for which the properties should be displayed. The combobox lists all controls accessible. Additionally, the form itself can be selected by typing TIPropertyGrid1.TIObject := self.
  • Use the Filter property if some data types should be excluded. Setting TIPropertyGrid1.Filter := [tkClass], for example, lists only properties which are classes.
  • The TIPropertyGrid not only diplays properties, it also allows to change them: Any value changed in the TIPropertyGrid is applied to the linked object.