### Use IndexOf with Int

To select a ComboBox item using IndexOf with an Int, the Int has to be converted first to a String.
If this is not done, IndexOf will not find the item.
IndexOf accepts the Int but does not find the item if these are strings.
Example
A ComboxBox is defined in a form.
The ComboBox items are filled by a list of strings (lines).
The item to look for (line) and set as selected is an Int.
`Public Sub Show(title As String, content As List, line As Int, lines As List)
frm.title = title & " - Line: " & line
' Add the content to the listview
lvwViewer.Items.AddAll(content)
' Fill the combobox with items found
cbLines.Items.AddAll(lines)
' Convert line in string to be able to set the index of the combobox
Dim s As String = line
' Set the selected item in the combobox which triggers goto that line in the listview
cbLines.SelectedIndex = cbLines.Items.IndexOf(s)
frm.ShowAndWait
End Sub`

Changed: , Category: ComboBox, File: T6C175M1276.htm, ID: 1276