This shows how to USE the CONTROLS unit in a way that will work for all versions of Delphi (old and new) as well as VCL and FireMonkey.,
You can use variations of this for other units
There are other ways to achieve this, which I wont go into here.
The technique listed here is useful when developing Delphi controls or units that you will provide to other people. It works without requiring any changes to their project or IDE options.
uses {$IF CompilerVersion >= 23.0} // 23 is Delphi XE2 {$IF not declared(FireMonkeyVersion)} VCL.Controls, {$ELSE} FMX.Controls, {$IFEND} {$ELSE} // VCL prior to XE2 Controls, {$IFEND} MyOtherUnits;
+1 this post
If you like this post, please up-vote it on BeginEnd – Thank You
About The Author
The Usual Suspect
– Scott Hollows –
- Oracle and Delphi software developer.
- Australian Delphi User Group
– Western Australia Branch Manager
– National committee member
– Past president
![]() | ![]() | ![]() |
Leave a Reply