RichTextBox.GetPositionFromCharIndex(Int32) RichTextBox.GetPositionFromCharIndex(Int32) RichTextBox.GetPositionFromCharIndex(Int32) RichTextBox.GetPositionFromCharIndex(Int32) Method

定义

检索控件内指定字符索引处的位置。Retrieves the location within the control at the specified character index.

public:
 System::Drawing::Point GetPositionFromCharIndex(int index);
public System.Drawing.Point GetPositionFromCharIndex (int index);
member this.GetPositionFromCharIndex : int -> System.Drawing.Point
Public Function GetPositionFromCharIndex (index As Integer) As Point

参数

index
Int32 Int32 Int32 Int32

要检索其位置的字符索引。The index of the character for which to retrieve the location.

返回

指定字符的位置。The location of the specified character.

注解

此方法使您能够确定特定字符索引所在的控件中的位置。This method enables you to determine where in the control a specific character index is located. 对于此类任务,您可以使用此方法来显示快捷菜单项或控件中某个词的帮助信息。You can use this method for such tasks as displaying shortcut menu items or help information for a word in the control. 例如,如果想要在用户右键单击控件中的某个单词时向用户显示选项菜单,则可以使用此方法来确定 word 正确显示ContextMenu控件的位置。For example, if you wanted to display a menu of options to the user when the user right clicks on a word in the control, you can use this method to determine the position of the word to properly display a ContextMenu control.

适用于

另请参阅