Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to create an undo function in a picturebox?(Console Application,using windows form) [modified]

How to create an undo function in a picturebox?(Console Application,using windows form) [modified]

Scheduled Pinned Locked Moved C#
questiontutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrAdar
    wrote on last edited by
    #1

    hi... im working on a project and im getting in trouble here with the undo function... so..lets see...the user does an action in a picturebox...now what i want is..when he clicks a buuton called "Undo" the last action will be undone...how the hell do i do that? thanks in advance :) P.S if i want to use a blank sheet to instore a large code texts but still use them in the program how do i do that? :) andd...how do i cause a second form to show it self lets say..on a push of a button while another form is already running?

    modified on Monday, June 9, 2008 1:59 PM

    P E C 3 Replies Last reply
    0
    • M MrAdar

      hi... im working on a project and im getting in trouble here with the undo function... so..lets see...the user does an action in a picturebox...now what i want is..when he clicks a buuton called "Undo" the last action will be undone...how the hell do i do that? thanks in advance :) P.S if i want to use a blank sheet to instore a large code texts but still use them in the program how do i do that? :) andd...how do i cause a second form to show it self lets say..on a push of a button while another form is already running?

      modified on Monday, June 9, 2008 1:59 PM

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Wow - you don't want a lot, do you? There are many ways you can do the "Undo" functionality, but the easiest is probably this[^] implementation.

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      1 Reply Last reply
      0
      • M MrAdar

        hi... im working on a project and im getting in trouble here with the undo function... so..lets see...the user does an action in a picturebox...now what i want is..when he clicks a buuton called "Undo" the last action will be undone...how the hell do i do that? thanks in advance :) P.S if i want to use a blank sheet to instore a large code texts but still use them in the program how do i do that? :) andd...how do i cause a second form to show it self lets say..on a push of a button while another form is already running?

        modified on Monday, June 9, 2008 1:59 PM

        E Offline
        E Offline
        Edmundisme
        wrote on last edited by
        #3

        To support undo/redo operations, you'll want to read up on the "Command" design pattern. Google "Command Design Pattern" and you'll get a myriad of explanations.

        1 Reply Last reply
        0
        • M MrAdar

          hi... im working on a project and im getting in trouble here with the undo function... so..lets see...the user does an action in a picturebox...now what i want is..when he clicks a buuton called "Undo" the last action will be undone...how the hell do i do that? thanks in advance :) P.S if i want to use a blank sheet to instore a large code texts but still use them in the program how do i do that? :) andd...how do i cause a second form to show it self lets say..on a push of a button while another form is already running?

          modified on Monday, June 9, 2008 1:59 PM

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          MrAdar wrote:

          the user does an action in a picturebox...

          At this point, your design is broken. IF there are actions, you probably should not use a picturebox.

          MrAdar wrote:

          how do i cause a second form to show it self lets say..on a push of a button while another form is already running

          You really need to buy a book. You want a modeless form, which means you call Show instead of ShowDialog.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups