Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TextEditBase.SetSelection(Int32) Method

Selects the editor’s text starting from the specified character to the last character.

Namespace: DevExpress.Maui.Editors

Assembly: DevExpress.Maui.Editors.dll

NuGet Package: DevExpress.Maui.Editors

#Declaration

C#
public void SetSelection(
    int start
)

#Parameters

Name Type Description
start Int32

The zero-based index of the first selected character.

#Remarks

The following code sample selects all the characters after the first character:

<ContentPage ...
    xmlns:dxe="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors">
    <ContentPage.Content>
        <StackLayout>
            <Button Clicked="SelectText_Clicked" Text="Select Text"/>
            <dxe:TextEdit x:Name="textedit" Text="Input Text" />
        </StackLayout>
    </ContentPage.Content>
</ContentPage>
public partial class MainPage : ContentPage {
    // ...
    private void SelectText_Clicked(object sender, EventArgs e) {
        textedit.SetSelection(1);
    }
}

Text Editor

See Also