Langue

TextBox.GetCharacterIndexFromPoint(Point, Boolean) Méthode

Définition

Retourne l’index de base zéro du caractère le plus proche du point spécifié.

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

Paramètres

point
Point

Point dans l’espace TextBox de coordonnées pour lequel retourner un index.

snapToText
Boolean

true pour retourner l’index le plus proche s’il n’y a pas de caractère au point spécifié ; false pour retourner -1 s’il n’existe aucun caractère au point spécifié.

Retours

Index du caractère le plus proche du point spécifié, ou -1 si aucun index valide n’est trouvé.

S’applique à

Voir aussi