語言

TextBox.GetCharacterIndexFromPoint(Point, Boolean) 方法

定義

回傳最接近指定點的字元零為基礎的索引。

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

參數

point
Point

座標空間中的 TextBox 一點,用來回傳索引。

snapToText
Boolean

true 若指定點無字元,則回傳最近索引; false 若指定點沒有字元,則返回 -1。

傳回

指最接近指定點的字元索引,若找不到有效索引則為 -1。

適用於

另請參閱