Solved

Create an Undo button

Posted on 2008-10-08
7
1,745 Views
Last Modified: 2013-11-27
My question is simple, though I imagine the answer may end up being beyond my skill.  I have a form, which has multiple check-boxes, buttons, etc.  I want to add an 'Undo' button that will step back (even if it's only one step back, and can't go back multiple steps) whenever clicked.

I have been all around search engines trying to get even a starting point, and to my surprise, I have found very little that was any help at all to me.

If anyone can help me, it would be much appreciated, as this project's deadline is 10/10, which is in less than 2 days, lol.  If all you have is code that I can use, that is fine, but I would very much like to understand how it works so I can work with it more in the future, so an explanation, or link to a tutorial would be wonderful.
0
Comment
Question by:Sereou
7 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 250 total points
Comment Utility
0
 
LVL 32

Expert Comment

by:Daniel Wilson
Comment Utility
Well ... you need some structure storing the previous state of your form.

The state you need to save -- is it all checkbox values?  Text box values?

Are the elements tied to a database?

How granular does the Undo need to be?  A separate state for every character entered or check changed?  Or just a separate state for each time the thing is submitted to the DB?

Somehow you'll need to look at a trail of changes made.  And the above questions will help determine the data structure  to use for it.
0
 

Author Comment

by:Sereou
Comment Utility
The state I need to save consists of text box values, with a few check boxes that can be ignored if need be.

Yes, the elements are tied to a database, an Access DB to be specific.

I don't need it to be every character entered, it can be a separate state for each thing submitted to the DB (not neccesarily updated via a query or what have you, but maybe if a field is deleted, or typed over?)

I'm taking a look at those links too, though I only know VB, hehe, and most of those seem to be C# or C++, so I'm slowly translating as I go =)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
Since you are familiar with VB.NET, consider the VB.NET version of Rocky Lhotka's book:

http://books.google.co.in/books?id=AS7zAQaKt-oC&printsec=frontcover&dq=Experrt+VB.NET+2005+Business+Objects&sig=ACfU3U0SQCLKTC2VrJX5z3QssBKyroVmJg

This is precisely the same book, but written for VB.NET, as suggeted by sunnycoder's last link, above.  The examples are precisely the same, the only difference is that the code is written in VB.NET rather than C#.
0
 
LVL 44

Assisted Solution

by:Arthur_Wood
Arthur_Wood earned 250 total points
Comment Utility
here is the link to the pages in the VB.NET version that precisely correspond to the C# code pafges from sunnycoder's link:

http://books.google.co.in/books?id=AS7zAQaKt-oC&pg=PA64&dq=.net+undo+functionality+implementation&sig=ACfU3U1WhSfINEFbiAq4M2-o8r5YkDWV_g

AW
0
 

Author Comment

by:Sereou
Comment Utility
The information in the book looks good, I'll look over it and see if I can find a solution.  I'm not sure I have time to study the information before my deadline though.  It's looking like 'Undo' functionality will not be implemented in my project.  Thank you guys for your help, I'll respond back again as soon as I look over the book and see if I can pull it off in one day, lol.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
Glad to be of assistance.

AW
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now