Search code examples
delphicomponents

Is there a way that I could see the codes behind a visual and non-visual component?


I was just wondering if there is a way that I could go down to the codes of a component (visual or non-visual)? It would be a great relief for a coder to understand how a component behaves in the back-end. Perhaps, a coder could do some changes or add complementary codes to fit its requirement.


Solution

  • If your Delphi includes the source code then its easy.

    Switch to the unit of the form that includes the component

    enter image description here

    Go to the declaration of the component, right-click on the the component's type and the click on Find Declaration

    enter image description here

    And there you go, the component's code.

    enter image description here

    Now you can Find Declaration on the ancestor, in this case TCustomPanel and see how the ancestor is made.

    There are many resources explaining how they all fit together and many on how to create components. Once you understand classes and this whole Object Orientated thing then you will find it easier.

    I started creating components long ago and by looking at the source code of other components I learned so much. I still do.