PrivateSub SelectString(ByValstrAsString)
' Attempt to find passed in string.
Dim index AsInteger = Me.UltraComboEditor1.FindString(str)
If index <> -1 Then' String has been found, highlight it. First restore appearance on non
' highlighted items
Dim i AsIntegerFor i = 0 ToMe.UltraComboEditor1.Items.Count - 1
If i <> index ThenMe.UltraComboEditor1.Items(i).Appearance.FontData.Reset()
Me.UltraComboEditor1.Items(i).Appearance.ResetBackColor()
EndIfNext i
' Highlight the found item in the list
Dim item As Infragistics.Win.ValueListItem = Me.UltraComboEditor1.Items(index)
item.Appearance.BackColor = Color.Yellow
item.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True
' Set the selected item
Me.UltraComboEditor1.SelectedItem = item
EndIfEnd Sub
privatevoid SelectString(string str)
{
// Attempt to find passed in string.
int index = this.ultraComboEditor1.FindString(str);
if (index != -1)
{
// String has been found, highlight it. First restore appearance on non
// highlighted items
for(int i = 0; i < this.ultraComboEditor1.Items.Count ; i++)
{
if (i != index)
{
this.ultraComboEditor1.Items[i].Appearance.FontData.Reset();
this.ultraComboEditor1.Items[i].Appearance.ResetBackColor();
}
}
// Highlight the found item in the list
Infragistics.Win.ValueListItem item = this.ultraComboEditor1.Items[index] as Infragistics.Win.ValueListItem;
item.Appearance.BackColor = Color.Yellow;
item.Appearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True ;
// Set the selected item
this.ultraComboEditor1.SelectedItem = item;
}
}