Switch control types (but not names) for a large number of form controls in Delphi

I need to switch each control of a certain type on a form to a different type, keeping the name and code associated with each control.

For example, let's say I need to switch dozens or more of TEdit fields into TSpinEdits. How can I do this in Delphi 2007 with minimal effort?

+4
source share
3 answers

Use GExperts Replace Expert Components. It's free, and it's the only tool I've seen that does what you ask for, including matching properties from the old component to the new.

+14
source

If you do not want to use any external tools, you can always try switching to viewing the form as text, then search and replace TEdit with TSpinEdit. When you switch back and save the form, the IDE should tell you that the declarations in the .pas file are incorrect and offer to fix them automatically. Property mappings should not be a problem if there are no properties that are named differently that you want to map from one class to another. Properties that do not exist in the new class will be deleted. Here's how it works in Delphi 7 anyway ...

If you are unsatisfied with the results, you can try GExperts, as Craig recommended, which are a great addition to the IDE for many reasons.

+9
source

I use the CNTools component component (I can not find it in GExperts), it also got a good component selection function, so you can select several controls based on some simple queries.

+1
source

All Articles