Automatic text completion in AutoCompleteBox in Windows Phone

You can change this behaviour slightly such that the first possible suggested word / sentence is filled in the AutoCompleteBox .

To do that Just set the IsTextCompletionEnabled property of the AutoCompleteBox to True.

Automatic text completion in AutoCompleteBox in Windows Phone

public partial class MainPage : PhoneApplicationPage

{

// Constructor

public MainPage()

{

InitializeComponent();

AddAutocomplete();

}

public void AddAutocomplete()

{

AutoCompleteBox txtbox = new AutoCompleteBox();

txtbox.IsTextCompletionEnabled = true;

stack.Children.Add(txtbox);

// Data

txtbox.ItemsSource = GetSports();

}

public List<string> GetSports()

{

List<string> Sports = new List<string>();

Sports.Add("Cricket - One Day");

Sports.Add("Cricket - Test");

Sports.Add("Tennis");

Sports.Add("Table Tennis");

Sports.Add("Hockey");

Sports.Add("Football");

return Sports;

}

}

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

This blog post will guide you through several effective methods to troubleshoot and resolve the issue of Microsoft Edge not...
Windows 11 offers a range of audio enhancements that can enrich your listening experience. These enhancements include features like virtual...
Windows 11 brings a fresh and visually stunning design to your desktop, and one of the standout features is the...