Solved

Create an Undo button

Posted on 2008-10-08
7
1,747 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
ID: 22671061
0
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 22671086
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
ID: 22671152
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 22671735
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
ID: 22671766
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
ID: 22672354
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
ID: 22679547
Glad to be of assistance.

AW
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

948 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

21 Experts available now in Live!

Get 1:1 Help Now