Glen Morse
Glen Morse

Reputation: 2593

Creation of a new component

If I make a component and register it, then later want to change the properties of that component.
Do I have to re-register it as a new component or can I edit the current component?

Upvotes: 1

Views: 216

Answers (2)

Johan
Johan

Reputation: 76567

The answer is it depends

Reinstall required for design time changes
If you make changes to the published properties of a component, they will not show during design time unless you uninstall and reinstall it.

This is because Delphi keeps the component in a BPL file, which is binary.

No reinstall needed if...
If the changes only affect the run time behavior, then you don't need to reinstall the component, because Delphi will pickup the source code.

But the component source needs to be visible in your project code
However for this last option to be true, the source code of the component needs to be in the search path of your project, otherwise it will still pick up the data from the .bpl file.

Reinstalling a component is easy in XE2 though.
Step 1: open the .dpk file your component is in
Step 2: make changes to the .pas file of your component
Step 3: Install
enter image description here

If you choose install, Delphi will automatically reinstall your component.
If compilation is unsuccessful your old version will stay installed.

Note
You don't register a new component, you change the source code of the currently registered (installed is the current lingo) component and re-install it by choosing install.

Upvotes: 2

Gustavo Toyota
Gustavo Toyota

Reputation: 23

No, you don't need to re-register it. All you'll have to do is recompile the package where the component is in.

Upvotes: -1

Related Questions