-
Собственно сабж!
-
procedure TForm1.KOLForm1FormCreate(Sender: PObj); var Header: THandle; begin HideCaret(RichEdit1.Handle); end;
function TForm1.KOLForm1Message(var Msg: tagMSG; var Rslt: Integer): Boolean; begin Result := FALSE; if (not AppletTerminated) and Assigned(RichEdit1) then HideCaret(RichEdit1.Handle); end;
-
Вот попробовал на этом примере, но результат нулевой! Каретка не исчезает. Где ошибка?
Program ZZZ;
uses windows, messages, KOL;
var W, Edit:PControl;
Procedure StartForm;
begin
W := NewForm( Applet, 'Моё окно' ).SetSize( 400, 300 );
W.CenterOnParent;
W.Margin := 0;
W.Font.FontName:='Tahoma';
W.Font.FontHeight:=16;
Edit:=NewRichEdit(W, [eoNoHScroll, eoReadonly]).SetSize(524,300);
HideCaret(Edit.Handle);
Run( W );
end;
begin
StartForm;
end.
-
program Project1;
uses
Windows, Messages, Kol;
var Form, RE: PControl;
function REMessage(Dummy: Pointer; var Msg:TMsg; var Rslt: Integer): Boolean;
begin
Result := False;
if Msg.message = WM_SETFOCUS then
begin
HideCaret(RE.Handle);
Result := True;
end;
end;
begin
Form := NewForm(nil, 're');
RE :=NewRichEdit(Form, []).SetAlign(caClient);
RE.OnMessage := TOnMessage(MakeMethod(nil, @REMessage));
Run(Form);
end.
-
Program ZZZ; uses windows, messages, KOL; var W, Edit:PControl; {----------------------------------------------------------------------------} function REMessage(Dummy: Pointer; var Msg:TMsg; var Rslt: Integer): Boolean; begin Result := False; if Msg.message = WM_SETFOCUS then begin HideCaret(Edit.Handle); Result := True; end; end;
{----------------------------------------------------------------------------} Procedure StartForm; begin W := NewForm( Applet, 'Моё окно' ).SetSize( 400, 300 ); W.CenterOnParent; W.Margin := 0; W.Font.FontName:='Tahoma'; W.Font.FontHeight:=16; Edit:=NewRichEdit(W, [eoNoHScroll, eoReadonly]).SetSize(524,300); //HideCaret(Edit.Handle); Edit.OnMessage := TOnMessage(MakeMethod(nil, @REMessage));
Run( W ); end; {----------------------------------------------------------------------------} begin StartForm; end.
-
RusSun, Дмитрий К - огромное спасибо! Всё работает!!!
|