Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetCharFromPosition Method

TextBoxBase.GetCharFromPosition Method

Note: This method is new in the .NET Framework version 2.0.

Retrieves the character that is closest to the specified location within the control.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public virtual char GetCharFromPosition (
	Point pt
)
public char GetCharFromPosition (
	Point pt
)
public function GetCharFromPosition (
	pt : Point
) : char

Parameters

pt

The location from which to seek the nearest character.

Return Value

The character at the specified location.

If the location specified in the pt parameter is outside the client area of the control, the first character of the string closest to the point specified in pt is returned. You can use this method to determine which characters are located near a specific point within the control. You can then use this value to perform operations on the text at that location.

NoteNote

If the specified location in the pt parameter is located on the right side of the client area of the control, the last character of the string closest to the point specified in pt is returned.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2015 Microsoft