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。