private int GetIndexOf(ListBox.ObjectCollection list, string value)
{
if (string.IsNullOrEmpty(value)) return -1;
int idx = 0;
foreach (object l in list)
{
string src = l as string;
if (string.IsNullOrEmpty(src))
{
idx += 1;
continue;
}
if (string.Compare(src, value, StringComparison.OrdinalIgnoreCase) == 0)
{
return idx;
}
idx += 1;
}
// Not Found
return -1;
}