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 -> intPublic Function GetCharacterIndexFromPoint (point As Point, snapToText As Boolean) As Integer参数
- snapToText
- Boolean
如果指定点处没有字符,则 true 将返回最近的索引,false 将返回 -1。
返回
最接近指定点的字符的索引;如果找不到有效的索引,则为 -1。