AdvRichEditor and ribbons...


Searching documents and testing, no solution for these items.

On the font ribbon, how to change the drop count for the two popup menus?

How to make the richedit control transparent?

I found this:

VCL New Features in RAD Studio 11, The New RichEdit Control

The most visible new feature is TRichEdit migration to the most recent platform version, the RichEdit control 4.1 implemented by MSFTEDIT.dll. Beside a general improvement, the new controls offers features like spell checking, URL recognition, transparency, with new properties that include Transparent, EnableURLs, SpellChecking, and the new OnLinkClick event.

Does AdvRichEditor support transparency?

How to determine the total size of all the elements, the width and height in pixels required to fully render the elements?

Normally I would draw to a path, get max and min points,...

How to determine the column and line of the caret position? I want to show the values in a status bar.



  1. You'd need to loop over AdvRichEditorFontRibbonToolBar1.Controls and check for TComboBox and for these you can change the DropDownCount property.
  2. TAdvRichEditor is not based on any Windows control and does not have Windows dependencies like the standard TRichEdit. It is written from the ground up in VCL but it doesn't have a transparency setting.
  3. To expose the text size calculation, you can write code like:
  TAdvRichEditorClass = class(TAdvRichEditor);

procedure TForm1.FormCreate(Sender: TObject);
  sz: TSize;
  sz := TAdvRichEditorClass(AdvRicheditor1).GetSize(false,0)

Thanks Bruno.

How to determine the column and line of the caret position? I want to show the values in a status bar.

GetSize is protected in I assume not protected in the next release?

Not decided yet. For now, you can use the method provided.

I guess I am confused.
The size will change based on what is added to the editor, no? I want to get the size after the user has added/removed/edited/etc.. and is closing the form.

And "TAdvRichEditorClass" is not defined, via searching the "TMS VCL UI Pack" directory.

What I am showing is basically the same as what is explained here:

To access a protected member in Delphi using typecasting, you can create a new type that matches the class with the protected member / method and then cast an instance of the original class to this new type. Here's a step-by-step example:

Step-by-Step Example

  1. Define the class with a protected member:


Copy code

  TMyClass = class
    FProtectedMember: Integer;
    constructor Create;

constructor TMyClass.Create;
  FProtectedMember := 0;  // Initial value
  1. Define a new type with the same structure:


Copy code

  TMyClassAccess = class(TMyClass)
    property ProtectedMember: Integer read FProtectedMember write FProtectedMember;
  1. Use typecasting to access the protected member:


Copy code

  MyObject: TMyClass;
  AccessObject: TMyClassAccess;
  MyObject := TMyClass.Create;
    // Cast MyObject to TMyClassAccess to access the protected member
    AccessObject := TMyClassAccess(MyObject);
    // Now you can access the protected member
    AccessObject.ProtectedMember := 10;


  • TMyClass: This is the original class with the protected member FProtectedMember.
  • TMyClassAccess: This new type is derived from TMyClass and exposes the protected member through a public property ProtectedMember.
  • Typecasting: By casting MyObject (of type TMyClass) to TMyClassAccess, you can access the protected member as if it were public.

Key Points

  • Typecasting: The line AccessObject := TMyClassAccess(MyObject); casts MyObject to TMyClassAccess, allowing you to access the protected member.
  • Property Access: The property ProtectedMember in TMyClassAccess provides public read and write access to the protected member FProtectedMember.

Yeah I know how to do that. Missed the declaration when I read the original response.

This works:

for i:=0 to AdvRichEditorFontRibbonToolBar1.ControlCount - 1 do
  if (AdvRichEditorFontRibbonToolBar1.Controls[i] is TAdvCustomOfficeComboBox) then
1 Like