Questa documentazione è stata archiviata e non viene gestita.

Metodo TextBox.GetCharacterIndexFromPoint

Returns the zero-based insertion index for a specified point.

Spazio dei nomi: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)

public int GetCharacterIndexFromPoint (
	Point point,
	bool snapToText
)
public int GetCharacterIndexFromPoint (
	Point point, 
	boolean snapToText
)
public function GetCharacterIndexFromPoint (
	point : Point, 
	snapToText : boolean
) : int
Non è possibile utilizzare metodi in XAML.

Parametri

point

A point in TextBox coordinate-space for which to return an insertion index.

snapToText

true to return the nearest insertion index if there is no character at the specified point; false to return -1 if there is no character at the specified point.

Valore restituito

The insertion index for the specified point, or -1 if no valid insertion index can be found.

An insertion index references a position between characters; contrast with a character index, which references specific characters. Text that is N characters long will have N+1 possible insertion indices. An insertion index of M could mean the given point was in the right half of the character to the left of M, or on the left half of the point to the right of M.

Microsoft .NET Framework 3.0 è supportato in Windows Vista, Microsoft Windows XP SP2 e Windows Server 2003 SP1.

.NET Framework

Supportato in:
Mostra: