unit uMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, SynEdit, SynMemo, SynEditHighlighter, SynHighlighterGeneral, StdCtrls,
ComCtrls;
const
WM_MYMEMO_ENTER = WM_USER + 500;
type
TForm1 =
class(TForm)
SynMemo1: TSynMemo;
SynGeneralSyn1: TSynGeneralSyn;
Memo1: TMemo;
RichEdit1: TRichEdit;
procedure SynMemo1Enter(Sender: TObject);
procedure RichEdit1Enter(Sender: TObject);
procedure RichEdit1Change(Sender: TObject);
procedure RichEdit1Click(Sender: TObject);
private
procedure WMMYMEMOENTER(
var Message: TMessage) ;
message WM_MYMEMO_ENTER;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.RichEdit1Change(Sender: TObject);
begin
CreateCaret(RichEdit1.Handle,0,5,15);
ShowCaret(RichEdit1.Handle);
end;
procedure TForm1.RichEdit1Click(Sender: TObject);
begin
CreateCaret(RichEdit1.Handle,0,5,15);
ShowCaret(RichEdit1.Handle);
end;
procedure TForm1.RichEdit1Enter(Sender: TObject);
begin
PostMessage(
Handle, WM_MYMEMO_ENTER, 0, 0) ;
end;
procedure TForm1.SynMemo1Enter(Sender: TObject);
begin
//PostMessage(Handle, WM_MYMEMO_ENTER, 0, 0) ;
end;
procedure TForm1.WMMYMEMOENTER(
var Message: TMessage) ;
begin
//CreateCaret(SynMemo1.Handle,0,5,15);
//ShowCaret(SynMemo1.Handle);
CreateCaret(RichEdit1.Handle,0,5,15);
ShowCaret(RichEdit1.Handle);
end;
end.