private void updatecombo(ComboBox cb,
System.Collections.Specialized.StringCollection strs,
string t)
{
if (cb.Items.IndexOf(t) != 0)
{
// should save selection and cursor position here
int ss = cb.SelectionStart;
int sl = cb.SelectionLength;
cb.Items.Remove(t);
cb.Items.Insert(0, t);
cb.Select(ss, sl);
strs.Clear();
foreach (string i in cb.Items)
{
strs.Add(i);
}
Properties.Settings.Default.Save();
}
if (!cb.Text.Equals(t))
{
cb.Text = t;
}
}