Detect cursor position in TWebBrowser at edit mode

淺唱寂寞╮ 提交于 2019-12-11 02:20:10

问题


I get selection range like this:

var
  Range: IHTMLTxtRange;
begin
  if Supports((Document as IHTMLDocument2).selection.createRange,
    IHTMLTxtRange, Range)
end;

TWebBrowser in editing. I need get position of cursor. How I can get its?


回答1:


IHTMLTxtRange defines several attributes to get what you need.

But the key items are boundingLeft and boundingTop

This link has some details on how it works as well.



来源:https://stackoverflow.com/questions/2621883/detect-cursor-position-in-twebbrowser-at-edit-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!