Delphi XE4 FireMonkey TMemo Transparent? (iOS)
Asked Answered
C

2

6

Is there any way to make the TMemo transparent in Delphi/iOS/FireMonkey?

I don't see any way to edit styles myself when selecting + right-clicking the memo control...

Cruce answered 15/7, 2013 at 11:24 Comment(0)
M
8

Try removing memo's background on applying style event.

procedure TForm1.Memo1ApplyStyleLookup(Sender: TObject);
var
  BckObject: TFmxObject;
begin
  BckObject := Memo1.FindStyleResource('background');
  if Assigned(BckObject) and (BckObject is TSubImage) then
  begin
    TSubImage(BckObject).Source := nil;
  end;
end;
Mulholland answered 20/7, 2013 at 17:38 Comment(0)
R
2

You need to change the style of the control you want to display transparent as you want. Unfortunately Embarcadero does not provide a fully functional example, only some information on the Customizing FireMonkey Applications with Styles topic

Returnee answered 15/7, 2013 at 13:16 Comment(6)
I see this: "To see the style definitions in the FireMonkey Style Designer: Drop a control on a form in the Form Designer. Right-click the control and choose Edit Default Style" ... but I don't have any option called Edit Default Style which is rather odd. Does this work for you? Is my XE4/Pro + mobile addon installation messed up somehow?Cruce
@tom, this menu items have been deliberately removed when developing iOS apps. Getting to the built in styles for iOS is very complex.Mercurialize
@MikeSutton, actually it was removed because there was a serious bug that still hasn't been resolved. There is no reason to remove this otherwise and will eventually be reintroduced.Scop
Any alternative way of getting a transparent TMemo then? :)Cruce
@Cruce Just as an idea. Have you tried removing background on applying style event? procedure TForm1.Memo1ApplyStyleLookup(Sender: TObject); var BckObject: TFmxObject; begin BckObject := Memo1.FindStyleResource('background'); if Assigned(BckObject) and (BckObject is TSubImage) then begin TSubImage(BckObject).Source := nil; end; end;Mulholland
@slotomo That works! Make it answer and I will give bounty :)Cruce

© 2022 - 2024 — McMap. All rights reserved.