How to create an undo function in a picturebox?(Console Application,using windows form) [modified]
-
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
-
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
-
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
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.
-
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
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 )