Solved

Create an Undo button

Posted on 2008-10-08
7
1,760 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 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