Aliev
asked on
How to view the word under the mouse in richedit.
Hi, experts. My question is about WinAPI.
2 components in the form: RichEdit and Label
How to make that when mouse over the rich edit in label caption shows word under the mouse cursor(in richedit).
I seen this example on the internet and used it works. But now i cant find it. Help please. Thanks....
Regards,
Adil Aliev,
Baku, Azerbaijan,
adil@aliev.info
2 components in the form: RichEdit and Label
How to make that when mouse over the rich edit in label caption shows word under the mouse cursor(in richedit).
I seen this example on the internet and used it works. But now i cant find it. Help please. Thanks....
Regards,
Adil Aliev,
Baku, Azerbaijan,
adil@aliev.info
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks and how i can do it not on other components?
(TWebBrowser, Memo ...)
(TWebBrowser, Memo ...)
ASKER
Previous comment was incorrect
Thanks and how i can do it on other components?
(TWebBrowser, Memo ...)
Thanks and how i can do it on other components?
(TWebBrowser, Memo ...)
In a TMEMO you can do that on a MouseDown
procedure TForm1.Memo1MouseDown(Send er: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var row,col : integer;
t : string;
i,j : integer;
begin
Row := SendMessage(Tmemo(Sender). Handle, EM_LineFromChar, Tmemo(Sender).SelStart, 0);
Col := Tmemo(Sender).SelStart - SendMessage(Tmemo(Sender). Handle, EM_LineIndex, Row, 0);
t:=Tmemo(Sender).lines[row ];
i:=col;
j:=col;
while (i>0) and (copy(t,i,1)<>' ') do dec(i,1);
while (j<=length(t)) and (copy(t,j,1)<>' ') do inc(j,1);
inc(i,1);
t:=copy(t,i,j-i);
Label1.caption := t;
end;
procedure TForm1.Memo1MouseDown(Send
Shift: TShiftState; X, Y: Integer);
var row,col : integer;
t : string;
i,j : integer;
begin
Row := SendMessage(Tmemo(Sender).
Col := Tmemo(Sender).SelStart - SendMessage(Tmemo(Sender).
t:=Tmemo(Sender).lines[row
i:=col;
j:=col;
while (i>0) and (copy(t,i,1)<>' ') do dec(i,1);
while (j<=length(t)) and (copy(t,j,1)<>' ') do inc(j,1);
inc(i,1);
t:=copy(t,i,j-i);
Label1.caption := t;
end;
ASKER
And on TWebBrowser???
Dear friend...your question was 'How to view the word under the mouse in richedit' and it was answered, then another additional about TMemo had a solution too...
Well, i think that should be better to accept first the answer and award points before to ask additional questions...
Then remember: usually one question for one answer in one thread....
F68
Well, i think that should be better to accept first the answer and award points before to ask additional questions...
Then remember: usually one question for one answer in one thread....
F68
http://delphi.about.com/bltip1203.htm