Editor for WinForms | ComponentOne
Editor for WinForms Task-Based Help / Selecting Characters in the C1Editor
In This Topic
    Selecting Characters in the C1Editor
    In This Topic

    You can use the SelectionStart property to specify the first character to select in the range. Use the SelectionLength property to specify how many characters should be selected.

    To write code in C#

    C#
    Copy Code
    private void button1_Click(object sender, EventArgs e)
            {
                C1Editor1.SelectionStart = 2;
                C1Editor1.SelectionLength = 6;
            }
    

    For example, the following code starts the selection after the second character in the C1Editor and continues until six characters are selected:


    Selecting characters in Editor

    Note: The Select method of C1Editor class can be used as an alternate method to select the text.