TMSFMXMemo ActiveLineSettings

The FMXMemo developer manual states: 

ShowActiveLine: When set to true, displays the active line in color, as defined with ActiveLineColor and ActiveLineTextColor.

i can't find how to set the ActiveLineTextColor.
I'm using the latest version, part of FMX UI Pack version


You can do this via the style manager (right-click component and choose to edit custom style)

Locate the actvelinecolor.activelinetextcolor:TText object in the style and change Font.FontColor

hm, the right-click on the TMSFMXMemo shows no "Edit custom style"

well, this is what i get on a right click on the TMSFMXMemo:

I cannot see why this context menu is missing in your IDE.

Do you see the context menu item when right-clicking on other (standard FMX controls) ?
Is this the latest version of the TMS FMX UI Pack you have installed?
Do you have all update packs for the IDE installed?

well, this is because i use a style book that is assigned to the main form. The stylebook contains the iOS Jet style. No other FMX control shows the mentioned entries in the popup.

As I already wrote, i'm using the latest FMX UI Pack v3.7 with Delphi 10.2 Update 3.

I double clicked the stylebook and didn't found any entry called ActiveLineTextColor ...


We do not have this particular style iOS Jet here. I retested this with several of the other included FireMonkey styles, but even after adding the style to the Stylebook on the form, the context menu to edit the style on controls remains available.
As I do not think it is normal this capability disappears from the context menu, I'd suggest to contact Embarcadero for this.

the moment you assign the stylebook to the main form, the last 2 entries in the popup vanish, regardless of what style is loaded

I'm not sure why Embarcadero designed it this way that you cannot change individual component styles anymore or if Embarcadero provides an alternative way to change a style in this scenario.

so, there is no posibility to change the text color of the active line when a style is in use?

Why Embarcadero is blocking customizing the style at design-time in this case it unclear to us.

To change the style in code at runtime via:

  obj: TFMXObject;
  obj := TMSFMXMemo1.FindStyleResource('activelinecolor');
  if Assigned(obj) and (obj is TRectangle) then
    (obj as TRectangle).Fill.Color := NewColor;

Thank you, but i was trying to change the color of the text in the active line and not the background color of the active line. Is the object 'activelinetextcolor' a TFont?

The text color is set via 'activelinetextcolor'

and what type is the style resource called 'activelivetextcolor'?

I tried with TText and it didn't worked.

You can inspect the entire style and its types when you drop the component on a new FMX form in a new FMX app and choose to edit its style.

well this is exactly what i did and came up with TText, but it doesn't work with 

  if Assigned(obj) and (obj is TText) then

actually, the obj is not assigned, meaning that FindStyleResource didn't found any member called 'activelinetextcolor' ...

i created a new FMX app for iOS, that contains only your TMSFMXMemo.
The code you posted on 24 Dec 2018 at 9:48am doesn't work.
The Obj is not assigned.
Do you have another solution?

It does not work when called in the FormCreate or in a Timer.

I don't know why, but it works when called In an event of the memo (eg. OnClick).