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

Services
Outsourcing
Input validation
TComponentInspector allows to validate the user input by OnValidateChar event. Set the event Result to True if the Key is valid char, otherwise to False. The following example shows how we can allow to enter only digits if the selected property is integer.
function TMainForm.ComponentInspectorValidateChar(Sender: TObject;
  TheIndex: Integer; var Key: Char): Boolean;
begin
  Result:=True;
  if Assigned(ComponentInspector.Properties[TheIndex]) then
    with ComponentInspector.Properties[TheIndex] do
      if TypeKind=tkInteger then
        Result:=
          (PropType=TypeInfo(TColor)) or
          (PropType=TypeInfo(TCursor)) or
          (Key in ['0'..'9']);
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-2008 Greatis Software