Xamarin.Forms | ComponentOne
Controls / Input / AutoComplete / Features / Highlight Matches
In This Topic
    Highlight Matches
    In This Topic

    The AutoComplete control enables quick identification of user input in the search result by highlighting the matching text. For this, the AutoComplete class provides the HighlightColor property that sets the highlight color for the matching characters. You can explicitly set this property to a specific color so that the user input string gets highlighted in the search results as shown in the following image.

    Highlight Background in AutoComplete

    The following code example shows setting the text highlight feature in the AutoComplete control.

    In Code

    C#
    Copy Code
    autoComplete.HighlightColor = Xamarin.Forms.Color.Coral;
    

    In XAML

    XAML
    Copy Code
    <c1:C1AutoComplete x:Name="autoComplete" ItemsSource="{Binding ItemsSource}" DisplayMemberPath="Name"
        HorizontalOptions="FillAndExpand" HighlightColor="Coral">