System.Windows.Forms.ToolStripTextBox.GetFirstCharIndexFromLine Method

Retrieves the index of the first character of a given line.

Syntax

public int GetFirstCharIndexFromLine (int lineNumber)

Parameters

lineNumber
The line for which to get the index of its first character.

Returns

The zero-based character index in the specified line.

Remarks

If the lineNum parameter is negative, ToolStripTextBox.GetFirstCharIndexFromLine(int) returns 0. If the lineNum parameter exceeds the number of lines in the control, ToolStripTextBox.GetFirstCharIndexFromLine(int) returns the first character index for the last line in the control.

ToolStripTextBox.GetFirstCharIndexFromLine(int) returns the first character index of a physical line. The physical line is the displayed line, not the assigned line. The number of displayed lines can be greater than the number of assigned lines due to word wrap. For example, if you assign two long lines to a System.Windows.Forms.RichTextBox control and set ToolStripTextBox.Multiline and ToolStripTextBox.WordWrap to true, the two long assigned lines result in four physical (or displayed lines).

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0