Delphi/CB
•  Greatis •  Security •  AppDatabase •  Utilities •  Visual Basic • .NET •  just4fun
Delphi / C++ Builder
Components, utilities and tips for Delphi and C++ Builder developers
More info
Object Inspector FAQ
Object Inspector Home
Delphi Components
See also
Products
Form Designer
Runtime Fusion
Print Suite
Commented Image
Image Editor  new!
Delphi Toys
Ultimate Pack  hot!

FAQs
Form Designer FAQ
Print Suite FAQ
Image Editor FAQ

Links
Software for .NET
Software for VB 6
Delphi Tips & Tricks

Follow us
LinkedIn Blogspot Twitter Facebook

Share this page
Adding and customizing the drop-down list
TComponentInspector allows to display the drop-down list with the possible values for each property and change the list contents. The follow example demonstrates adding the drop-down list for the Caption property of the form. First of all, we have to add the drop-down button by OnGetButtonType event.
procedure TfrmMain.ComponentInspectorGetButtonType(Sender: TObject;
  TheIndex: Integer; var Value: TButtonType);
begin
  with ComponentInspector do
    if Assigned(Properties[TheIndex]) and
      (Properties[TheIndex].Name='Caption') then Value:=btDropDown;
end;
Now just fill the drop-down list using OnGetValuesList event.
procedure TfrmMain.ComponentInspectorGetValuesList(Sender: TObject;
  TheIndex: Integer; const Strings: TStrings);
begin
  with ComponentInspector do
    if Assigned(Properties[TheIndex]) and
      (Properties[TheIndex].Name='Caption') then
      Strings.Text:='Caption 1'#13'Caption 2'#13'Caption 3';
end;

Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2011 Greatis Software