Как узнать физические координаты каретки в пикселях? |
Previous Top Next |
Code: |
{TRichEdit}
var pt: TPoint; begin with richedit1 do begin Perform(messages.EM_POSFROMCHAR, WPARAM(@pt), selstart); label1.caption := Format('(%d, %d)', [pt.x, pt.y]); end; end;
{TMemo and TEdit}
var r: LongInt; begin with memo1 do begin r := Perform(messages.EM_POSFROMCHAR, selstart, 0); if r >= 0 then begin label1.caption := IntToStr(HiWord(r)); label2.caption := IntToStr(LoWord(r)); end; end; end; |
©Drkb::00537
Взято с Delphi Knowledge Base: http://www.baltsoft.com/