Как найти позицию текстового курсора в пикселях? |
Previous Top Next |
Code: |
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; 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::00581