How To…Hide Object Inspector Properties

Question

“How can I hide some of the object inspector properties from my end-users?”

Solution

The following example shows how to use the PropertyCategoryManager to hide the EmailSettings property.

Download:  DesignerHideObjectInspectorProperties.zip

Sample Delphi code

uses
  ppInspector;


procedure TForm1.Button2Click(Sender: TObject);
var
  lPropertyCategory: TppPropertyCategory;
  liIndex: Integer;
begin

  // remove EmailSettings from the User Interface category
  lPropertyCategory := TppPropertyCategoryManager.PropertyCategories.ItemByName['User Interface'];
  liIndex := lPropertyCategory.PropertyNames.IndexOf('EmailSettings');
  lPropertyCategory.PropertyNames.Delete(liIndex);


  // add EmailSettings to the Ignore category
  lPropertyCategory := TppPropertyCategoryManager.PropertyCategories.ItemByName['Ignore'];
  lPropertyCategory.PropertyNames.Add('EmailSettings');

end;