async private void loadCategories() { menuCategories = await fb.ListMenuCategoriesName(parent.restaurantName); customerCheckedListBox.Items.Clear(); foreach (var item in menuCategories) { customerCheckedListBox.Items.Add(item); } for (int i = 0; i < customerCheckedListBox.Items.Count; i++) { if (parent.filterCategories.Contains(customerCheckedListBox.Items[i].ToString())) { customerCheckedListBox.SetItemChecked(i, true); } } }