在编辑模式下检测TWebBrowser中的光标位置 [英] Detect cursor position in TWebBrowser at edit mode

查看:93
本文介绍了在编辑模式下检测TWebBrowser中的光标位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这样的选择范围:

I get selection range like this:

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

正在编辑TWebBrowser.我需要获取光标的位置.我如何得到它?

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

推荐答案

IHTMLTxtRange defines several attributes to get what you need.

但是关键项是boundingLeft和boundingTop

But the key items are boundingLeft and boundingTop

此链接详细介绍了如何它也很好.

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

这篇关于在编辑模式下检测TWebBrowser中的光标位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆