2
Hello! I’m starting at Delphi and was creating a method to add margin to an object, but needed it to be for any object. Example of the code I was working on.
Below is the example of the code I made to create the margin
procedure EditRectangleMargin(rtObjeto : TRectangle; bottom : double; left : double; right : double; top : double);
Begin
//Seta a Magin do Objeto
rtObjeto.Margins.Bottom := bottom;
rtObjeto.Margins.Left := left;
rtObjeto.Margins.Right := right;
rtObjeto.Margins.Top := top;
But I would like to make a generic method that meets so much re-click when layout, label etc. You can create something like this in Delphi?
NOTE: I am using firemonkey
But how do I implement this, I mean, do I have to import something? because only Tcontrolsize appears, but this one doesn’t have the properties;
– tempoDeveloper
You don’t have to import anything, Tcontrol exists for sure :p If you change your function header to this: Procedure Editrectanglemargin(rtObject : Tcontrol; bottom : double; left : double; right : double; top : double); Gives some error in the compiler?
– Tiago Rodrigues
It worked, because I was using a Unit without Form so I had to import FMX.Controls; Vlw guy.
– tempoDeveloper
Ah ok ;) You’re welcome
– Tiago Rodrigues