Delphi TObject position change

  

By user3376886 I want to make a universal function that I can apply to numerous different components; however, I cannot just do

TObject.Position

It asks that I do

TButton(TObject).Position

This means that I would have to do

if TObject is TButton then
TButton(TObject).position…
if TObject is TLabel then
TLabel(TObject).position…

Is there a way to make it work as:

TObject.position

So that the function can be as universal as possible and not cluttered with switch/if statements…? …read more

Via: StackOverflow

Comments are closed.