TextBox.GetCharacterIndexFromPoint(Point, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回离指定点最近的字符的从零开始的索引。
public:
int GetCharacterIndexFromPoint(System::Windows::Point point, bool snapToText);
public int GetCharacterIndexFromPoint(System.Windows.Point point, bool snapToText);
member this.GetCharacterIndexFromPoint : System.Windows.Point * bool -> int
Public Function GetCharacterIndexFromPoint (point As Point, snapToText As Boolean) As Integer
参数
- snapToText
- Boolean
true 如果指定点上没有字符,则返回最近的索引; false 如果指定点没有字符,则返回 -1。
返回
最接近指定点的字符的索引;如果没有找到有效的索引,则 -1。