Link to home
Start Free TrialLog in
Avatar of Jenny12345
Jenny12345

asked on

How to keep track of pressed toggle buttons of the toolbar if I have an undo button on the toolbar?

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);
      PreviousImages.Add(y);
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?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial