Example #1
0
        protected void Del(DataStorage.ListBox listBox)
        {
            int temp = listBox.SelectedIndex;

            listBox.DisableItem(temp);
            TempValue[temp] = null;

            for (int i = 1; i < listBox.Items.Count; i++)
            {
                if (temp + i < listBox.Items.Count && !listBox.DisabledIndices.Contains(temp + i))
                {
                    listBox.SelectedIndex = temp + i;
                    break;
                }
                else if (temp - i >= 0 && !listBox.DisabledIndices.Contains(temp - i))
                {
                    listBox.SelectedIndex = temp - i;
                    break;
                }
            }
        }
Example #2
0
 protected void Del(DataStorage.ListBox listBox, int index)
 {
     listBox.SelectedIndex = 0;
     listBox.DisableItem(index);
     TempValue[index] = null;
 }