ToolStripTextBox.GetFirstCharIndexFromLine(Int32) 方法

定義

擷取指定行第一個字元的索引。

public:
 int GetFirstCharIndexFromLine(int lineNumber);
public int GetFirstCharIndexFromLine (int lineNumber);
member this.GetFirstCharIndexFromLine : int -> int
Public Function GetFirstCharIndexFromLine (lineNumber As Integer) As Integer

參數

lineNumber
Int32

要取得其第一個字元之索引的字行。

傳回

Int32

指定行中以零為起始的字元索引。

備註

lineNum如果參數為負數,則 GetFirstCharIndexFromLine 傳回 0。 lineNum如果 參數超過 控制項中的行數, GetFirstCharIndexFromLine 則會傳回 控制項中最後一行的第一個字元索引。

GetFirstCharIndexFromLine 會傳回實體行的第一個字元索引。 實體行是顯示的行,而不是指派的行。 顯示的行數可能大於因為自動換行而指派的行數。 例如,如果您將兩條長行指派給 RichTextBox 控制項,並將 和 WordWrap 設定 Multilinetrue ,則兩個長指派的行會產生四個實體 (或顯示) 行。

適用於

另請參閱