11,571 questions
See if this can work for you.
public class Operations
{
/// <summary>
/// Mock up of data
/// </summary>
/// <returns></returns>
public static List<string> Items() => Enumerable.Range(1, 10100).Select(x => $"{x} item").ToList();
}
Form code
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Shown += OnShown;
}
private async void OnShown(object sender, EventArgs e)
{
comboBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
await Task.Factory.StartNew(() =>
{
Invoke(new MethodInvoker(() => comboBox1.DataSource = Operations.Items()));
});
comboBox1.SelectedIndex = -1;
}
}
---