'How to store an Object inside a variable?

For a school project I am required to make a game in Delphi 2010. I decided to make Chess as I enjoy it.

To move the pieces around the board, I have set each piece as an Image and each tile as a pannel. My idea is that when the player clicks on a piece, it is set as "activePiece" and then when they click on a pannel, it does activePiece.setParentComponent([pannel name]). Is there a variable that can do this? If not, is there another way to do this? If not, is there a different method I can do to give the ability to move pieces?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source