I have a toolbar control that has about 5 toggle buttons and one of the buttons is an undo button. (Undo buttons is a regular push button) The buttons on the toolbar perform drawing fucntions like inverting an image or brighting an image etc. after each image change I store the state of that image to an arraylist like this..
private ArrayList PreviousImages = new ArrayList();
Bitmap y = new Bitmap(imageBox.Image);
so on my undo button click I
PreviousImages.RemoveAt(PreviousImages.Count - 1);
imageBox.Image = (Bitmap) PreviousImages[PreviousImages.Count - 1];
Now the problem is on the toggle buttons when I undo the buttons still look pressed and I don't have a way of knowing which change I just have undone. what is the best approach on solving this problem? Is there a way to add another column to my arraylist and keep track of which toolbar button that change belongs to?