Editor for WinForms | ComponentOne
C1.Win.C1Editor.4.5.2 Assembly / C1.Win.C1Editor Namespace / C1Editor Class / CreateRange Method / CreateRange(Int32,Int32) Method
The start position
The length of the range
Example

In This Topic
    CreateRange(Int32,Int32) Method
    In This Topic
    Creates a range that begins with the specified starting character and continues through the specified length of characters.
    Syntax
    'Declaration
     
    Public Overloads Function CreateRange( _
       ByVal start As System.Integer, _
       ByVal length As System.Integer _
    ) As C1TextRange
    public C1TextRange CreateRange( 
       System.int start,
       System.int length
    )

    Parameters

    start
    The start position
    length
    The length of the range

    Return Value

    The text range.
    Example
    This code demonstrates the CreateRange(Int32,Int32) method.
    private void button1_Click(object sender, EventArgs e)
    {
        c1Editor1.LoadXml("<html><head><title>Document</title></head><body><p>12<span>3</span>456</p></body></html>", new Uri("c:\\"));
        C1TextRange r = c1Editor1.CreateRange(1, 3);
        Console.WriteLine(r.Text);
        // Output: 234
    }
    See Also