Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great but for TRichEdit #6

Open
limelect opened this issue Nov 16, 2018 · 1 comment
Open

Great but for TRichEdit #6

limelect opened this issue Nov 16, 2018 · 1 comment

Comments

@limelect
Copy link

limelect commented Nov 16, 2018

How to change for richedit?

  Form1.Rich1.SelAttributes.Color := clRed;
  Form1.Rich1.SelAttributes.Style := [fsBold];

I tried

TRichEdit= Class (Vcl.ComCtrls.TRichEdit);

TRichEditStyleHookColor = class(TRichEditStyleHook)
private
procedure UpdateColors;
protected
procedure WndProc(var Message: TMessage); override;
public
constructor Create(AControl: TWinControl); override;
end;

if Control.Enabled then
begin
Brush.Color := TWinControlH(Control).Color;
SelAttributes.Color:=TWinControlH(Control).Color;<<< dose not work
FontColor := TWinControlH(Control).Font.Color;

@wantedxnn
Copy link

wantedxnn commented Dec 13, 2020

@limelect
Instead using
...
TRichEditStyleHookColor = class(TRichEditStyleHook)
...

use:
...
TRichEditStyleHookColor = class(TScrollingStyleHook)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants