Posts

Showing posts from May, 2019

Variants in Delphi. Use of Variant Array. How to check a Variant is unassigned or empty or clear ?

Sometimes it is necessary to store and change data whose type varies or cannot be determined at compile time. In these cases, we can use variables and parameters of type Variant, which represents values that can change type at run time. Variants are used to store any data type value and can  perform numerous operations at run time. For variants type values the compiler automatically performs type conversions. Once you have the variant value, you can assign it to any compatible-or incompatible-data type. If you assign a value to an incompatible data type, Delphi performs a conversion, if it can. Otherwise it issues a run-time error. By default, Variants can hold values of any type except records, sets, static arrays, files, classes, class references, and pointers. Use System.Variants unit. Example We declare a variant variable such as the following: var   V: Variant;    You can assign to it values of several different types: V := UnAssigned; V := NULL; ...

How to apply VCL Style to Delphi Open Dialog, Save Dialog, Print Dialog, Font Dialog, Menus and TTaskDialog ?

Image
We can apply styles to a Delphi Application by using provided VCL styles from Project -> Options -> Appearance -> Styles option. But problem with VCL style is that, it does not support for Menus, Popup Menus, System Menus, TTaskDialog Component and Common Dialogs like Open Dialog, Save Dialog, Print dialog, Font Dialog etc. So whit out above dialogs and menus a Delphi application is not completely VCL style applied. So here in this blog I will explain how to apply VCL style to Menus, Popup Menus, System Menus, TTaskDialog Component and Common Dialogs like Open Dialog, Save Dialog, Print dialog, Font Dialog etc. Rodrigo Ruz a Delphi MVP from Chile has provided a solution for that. He has relased ‘VCL Styles Utils’ units and classes for the above purpose.  VCL Styles Utils The VCL Styles Utils is a Delphi library which extend the RAD Studio VCL Styles, adding unique features like the support for Classic and New Common dialogs, Task Dialogs, Stylin...