Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Way to Replace a Visual Component in Delphi

In a Delphi Form, I would like to replace one visual component with another. Example: I want to replace a Panel component with an ElPanel from a 3rd party package.

I would like all identical properties and events of the first component to be transferred to the new one, and all the components that belong to the first component (e.g. Toolbars, memos,status bars, etc.) to end up placed on the new component exactly where they were on the first one.

Is there a best/easiest way to do this other than adding the new component to the form and meticulously transferring every property, event and component to it one-by-one?

like image 458
lkessler Avatar asked Oct 27 '08 01:10

lkessler


1 Answers

I do it as following:

  1. Right click on the form and choose (View as Text).
  2. Press Ctrl + F to search for the Component class name like TPanel and replace it with TElPanel
  3. Switch back to back to the form (View as form)
  4. In the interface section replace the TPanel with TElPanel.

if you have many components using GExperts will be more feasible solutions.

like image 50
Mohammed Nasman Avatar answered Oct 05 '22 00:10

Mohammed Nasman