.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Post New Web Links

How to Implement Undo and Redo in c#

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :Windows Application
 

Hi,

    I have a picture box in my page..i am drawing some graphics like circle ,ellipse and arrow on the picture box in the picturebox_mouseup event .I need to undo or redo the drawing that i have drawn on the picture box after clicking undo or redo button..i don't know how to implement this in my page..Can you please help me with code...Here is my code in the picturebox mouse_up event..

  private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
          
            blnDrawing = false;
            blnErasing = false;
            a =e.X;
            b=e.Y;
            
              if (circle == 1 || text == 1 || ellipse == 1 || arrow == 1)
                {

                   


View Complete Post


More Related Resource Links

BIDS undo/redo buttons

  
In MS Visual Studio 2008 on Windows Server 2008 or BIDS my undo / redo buttons are grayed out when I am editing an SSIS package. I would like to know if there is a way to enable this. I have searched and searched everything looks retardedly complicated to get this working. Help? Anyone, anyone... Microsoft are you there?

Problem implementing Undo/redo functionality in an UML editor

  
Ok so I will try to make this short.
I am implementing undo/redo functionality in an UML diagram editor. I have objects of classes, all implementing my VisualUMLComponent interface.
I have a class, VisualUMLCollection, implementing ObservableCollection<VisualUMLComponent> to keep track of all objects (classes, interfaces, arrows, comments, abstracts, etc) to draw on my Canvas object. This works fine.

Now to the point.
I try to implement undo/redo, with having each object having a pointer to a PreviousState and NextState of type VisualUMLComponent. As such, when I change an object, I can first Clone() it, and insert it at the proper place in the doubly linked list.
I have made class for the undo/redo functionality. It has two stacks undoStack and redoStack of type Stack<DiagramChange>. DiagramChange class represents changes in the diagram. It can have three types: Add, Remove and Alter, for when adding an object, removing an object, or changing an object respectively.

My problem is with the code below, that I get an ArgumentOutOfRangeException    at System.Windows.Media.VisualCollection.Insert(Int32 index, Visual visual), when I try to .Add an old state object to my VisualUMLCollection:

public
 void

undo/redo

  
how do i implement undo/redo features in C#

how to create undo / redo function into my form

  
Im new to VB but have a strong aptitude for code and with a bit of guidence I can usally get it done. Is this function tought to get working?

how to create undo / redo function into my form

  
I posted this in the wrong area sorry for that..
Im new to VB but have a strong aptitude for code and with a bit of guidence I can usally get it done. Is this function tought to get working?

how implement transformations in slideshow extender.

  

hiii,


i am working on ajax slideshow extender.

can anybody help in coding for 

1) implement transformations between slide to slide.

2) and the direction means orientation in changing of slides.


I hope u got my querries.

please help in this regard.


thanks in advance.


how implement this code

  

check this link

and how can i implement on aspx page to get value on textbox

http://www.acmetech.com/documentation/javascript/parse_magnetic_track_javascript.html


How to implement custom HttpContext for each request under class that implements IHTTPHandler

  

Hello All,

I created an application and implemented IHTTPHandler for all incoming request ending with ".aspx" extension.

Under "ProcessRequest" module, I am creating an instance of HttpContext (with URL attributes different from my application's URL i.e. if I am working on localhost then speciying Yahoo.com as its URL) and assigning it to "context" which comes as method argument.

After redirection, an error is generated. Also, the custom HTTPContext is not passed to the requested page (default.aspx, in my case.)

Code is as follows.

    Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
        Try
            Dim requestedUrl As String
            Dim targetUrl As String
            Dim urlLength As Integer
            'Save settings which will be used while redirecting to appropriate page
            requestedUrl = context.Request.RawUrl
            If requestedUrl.IndexOf("?") >= 0 Then
                targetUrl = requestedUrl.Substring(0, requestedUrl.IndexOf("?"))
            Else
                targetUrl = requestedUrl
            End If
            If targetUrl = Nothing Or targetUrl.Length = 0 Then
                targetUrl = requestedUrl
            End If
            urlLengt

Team System: Work Items and Undo Support

  

Add support for work items to the Team Foundation Server version control add-in.

Brian A. Randell

MSDN Magazine September 2007


{ End Bracket }: To Confirm is Useless, to Undo Divine

  

The common user interface technique of confirmation, popping a dialog box into the user's face and asking, "Are you really REALLY sure you want to do that?" is evil. It's unfriendly, it's distracting, and it's completely ineffective.

David S. Platt

MSDN Magazine March 2005


Cutting Edge: Implement Custom Cache Dependencies in ASP.NET 1.x

  

One of the most compelling improvements that ASP. NET brought to ASP programming was the Cache object. The Cache has some similarities to the Application object and is a container of global data (as opposed to session-specific data) that features a fair number of innovative characteristics.

Dino Esposito

MSDN Magazine July 2004


Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows

  

The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

MSDN Magazine March 2004


Data Access: Implement a Data Access Layer for Your App with ADO.NET

  

Implementing data access functionality is a core activity of most developers working with the .NET Framework, and the data access layers they build are an essential part of their applications. This article outlines five ideas to consider when building a data access layer with Visual Studio .NET and the .NET Framework. The tips include taking advantage of object-oriented techniques and the .NET Framework infrastructure by using base classes, making classes easily inheritable by following guidelines, and carefully examining your needs before deciding on a presentation method and external interface.

Dan Fox

MSDN Magazine April 2003


HTTP Pipelines: Securely Implement Request Processing, Filtering, and Content Redirection with HTTP

  

ASP.NET is a flexible and extensible framework for server-side HTTP programming. While most people think of ASP.NET in terms of pages served, there is a lower-level infrastructure sitting beneath this page model. The underlying plumbing is based on a pipeline of app, module, and handler objects. Understanding how this pipeline works is key if you want to get the most out of ASP.NET as an HTTP server platform, while making your process more efficient, and keeping your server secure. This article introduces the architecture of the pipeline and shows how you can use it to add sophisticated functionality to an ASP.NET-based app.

Tim Ewald and Keith Brown

MSDN Magazine September 2002


BizTalk: Implement Design Patterns for Business Rules with Orchestration Designer

  

Because the value of good software planning and design should never be underestimated, it can be beneficial to use one of the many existing design patterns as a foundation for solving some of your toughest architecture problems. This article describes several traditional design patterns including the Observer pattern and the Dispatcher pattern, elaborates on their structures, what they're used for, and how they can help you build a BizTalk-based solution. Following this is a discussion on using the BizTalk Orchestration Designer to build designs and integrate existing business processes.

Christian Thilmany and Todd McKinney

MSDN Magazine October 2001


Microsoft .NET: Implement a Custom Common Language Runtime Host for Your Managed App

  

While most application developers may not need to write a custom host, understanding what is involved provides a great deal of insight into the architecture of the CLR. After covering how the CLR is started and loaded into a process, how to set the available configuration options, and how a host defines application domains, this article explains how to design a custom host. Important concepts include making the right decisions about the application domain boundaries for the host, configuring them correctly, loading and executing user code, and resolving references to assemblies. Setting security policy and unloading application domains as the application shuts down are also explained.

Steven Pratschner

MSDN Magazine March 2001


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend