Why not use a 'Stack to save a certain number of the previous ComboBox selections ? This is a class I use to implement a fixed-size Stack of any Type:
using System.Collections.Generic;
namespace StackAndQueueUtilityClasses
{
public class StackT<T> : Stack<T>
{
private int Capacity { set; get; }
private Stack<T> tempStack;
public StackT(int capacity)
{
Capacity = capacity;
tempStack = new Stack<T>(Capacity);
}
public T GetLastValueIn()
{
return base.Peek();
}
public new T Pop()
{
return default(T);
}
public new void Push(T value)
{
if (this.Count == Capacity)
{
tempStack.Clear();
for (int i = 1; i < Capacity; i++)
{
tempStack.Push(base.Pop());
}
base.Clear();
for (int i = 1; i < Capacity; i++)
{
base.Push(tempStack.Pop());
}
}
base.Push(value);
}
}
}
So, if I want a stack of 'ints whose size is limited to #8:
StackT<int> testStack = new StackT<int>(8);
Note that here I have disabled access to 'Pop from outside any instance of the Class, and defined a Method 'GetLastValueIn to return the value at the top of the stack without removing it.
However, you could still call 'Clear to reset this 'Stack overload.
Also note that 'Capacity can only be set in the 'ctor of the Class.
If you want to access some value at a specific position in the Stack without removing the current entries ... you can write code to do that using the same techniques shown here.
There are other data structures you could explore for this: just search CodeProject on Queue, Stack, Circular Buffer.