ComponentOne Xamarin Edition
Highlight Matches
Controls > Input > AutoComplete > Features > Highlight Matches

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 HighlightedColor 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

Copy Code
autoComplete.HighlightedColor = Xamarin.Forms.Color.Coral;


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