dynamically create a Firemonkey drop shadow
Just a quick code example of how to dynamically create a drop shadow effect, pretty simple stuff but with the lack of documentation examples are rare so it seems. This example adds a drop shadow to a TMemo :-
Show Plain TextDelphi code
- uses
- ...
- FMX_Memo, FMX_Effects;
- ...
- var
- memo: TMemo;
- shadow: TShadowEffect;
- ...
- memo := TMemo.Create(self);
- memo.Parent := panel;
- memo.Align := TAlignlayout.alClient;
- memo.ReadOnly := true;
- memo.WordWrap := true;
- shadow := TShadowEffect.Create(self);
- shadow.Parent := memo;
- memo.AddObject(shadow);
For some reason I had problems adding a drop shadow effect to a TPanel with this same method, I'll give it another go when I have some time.
Hi, Is the AddObject method in memo really necesarry? What does it do? BTW Very nice style of the code presentation. (really legible)