Click here to Skip to main content
15,912,756 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: HELP!!! Pin
Christian Graus25-May-07 9:42
protectorChristian Graus25-May-07 9:42 
GeneralRe: HELP!!! Pin
Colin Angus Mackay26-May-07 5:45
Colin Angus Mackay26-May-07 5:45 
QuestionHow to play dvd movie with VB.net application? Pin
Prince Tanveer Farman25-May-07 8:56
Prince Tanveer Farman25-May-07 8:56 
AnswerRe: How to play dvd movie with VB.net application? Pin
Christian Graus25-May-07 9:42
protectorChristian Graus25-May-07 9:42 
Questioncan i install mpeg2 codecs programatically in VB.net application? if yes how Pin
Prince Tanveer Farman26-May-07 21:53
Prince Tanveer Farman26-May-07 21:53 
AnswerRe: can i install mpeg2 codecs programatically in VB.net application? if yes how Pin
Dave Kreskowiak27-May-07 4:02
mveDave Kreskowiak27-May-07 4:02 
QuestionHelp Creating Undo/Redo Class Pin
Richard Blythe25-May-07 6:54
Richard Blythe25-May-07 6:54 
AnswerRe: Help Creating Undo/Redo Class Pin
Ian Shlasko25-May-07 7:35
Ian Shlasko25-May-07 7:35 
Undo/Redo functionality is really based on what your application does.

If it's a text editor, you'd want to store which text was inserted/deleted/moved where. If it's a graphics program, you might want to store that drawing tool X was used at location Y. If it's a game, you'd want to store that the player moved from A to B, and what each enemy did in response.

In general terms, an Undo/Redo class is going to act like a list or array of state objects. The state object would need to:

1) Store data representing the action performed
2) Know how to "apply" that data to the application (Enter text, make a move, draw something)
3) Know how to reverse that process (Remove the text, back up a move, erase something)

I can't help you with the implementation of that state object, but the general functionality of the Undo/Redo would be:

(Storing an integer representing the location in the undo list)
Undo:
1) "Reverse" the state object at the current index
2) Add one to the index
3) If the index is greater than the size of your state array, disable undo

Redo (Enabled when index > 0):
1) Subtract one from the index
2) "Apply" the state object at the current index

User performs an action:
1) Remove any state objects less than the current index (So the current undo item is in position zero)
2) Insert a state object at the zero position that describes what the user just did
3) Set the index to zero (First item)

Sounds easy, of course figuring out that state object could be really difficult, depending on your app.
GeneralRe: Help Creating Undo/Redo Class Pin
Richard Blythe25-May-07 8:30
Richard Blythe25-May-07 8:30 
GeneralRe: Help Creating Undo/Redo Class Pin
Christian Graus25-May-07 9:44
protectorChristian Graus25-May-07 9:44 
GeneralRe: Help Creating Undo/Redo Class Pin
Kevin McFarlane26-May-07 2:00
Kevin McFarlane26-May-07 2:00 
QuestionNumericUpDown that updates as you type Pin
frobozzdamad25-May-07 6:03
frobozzdamad25-May-07 6:03 
AnswerRe: NumericUpDown that updates as you type Pin
Marcus J. Smith25-May-07 6:21
professionalMarcus J. Smith25-May-07 6:21 
GeneralRe: NumericUpDown that updates as you type Pin
frobozzdamad29-May-07 4:21
frobozzdamad29-May-07 4:21 
GeneralRe: NumericUpDown that updates as you type [modified] Pin
Marcus J. Smith29-May-07 4:54
professionalMarcus J. Smith29-May-07 4:54 
Questionhow to work with datagrid? Pin
sathyan_829425-May-07 5:08
sathyan_829425-May-07 5:08 
AnswerRe: how to work with datagrid? Pin
Marcus J. Smith25-May-07 6:19
professionalMarcus J. Smith25-May-07 6:19 
GeneralRe: how to work with datagrid? Pin
Flame11325-May-07 14:52
Flame11325-May-07 14:52 
Questionhow to work with datagrid? Pin
sathyan_829425-May-07 5:07
sathyan_829425-May-07 5:07 
QuestionFinding the Text value of a column... Pin
CCG325-May-07 4:39
CCG325-May-07 4:39 
AnswerRe: Finding the Text value of a column... Pin
Marcus J. Smith25-May-07 6:24
professionalMarcus J. Smith25-May-07 6:24 
GeneralRe: Finding the Text value of a column... Pin
CCG325-May-07 6:38
CCG325-May-07 6:38 
GeneralRe: Finding the Text value of a column... Pin
Marcus J. Smith25-May-07 7:53
professionalMarcus J. Smith25-May-07 7:53 
GeneralRe: Finding the Text value of a column... Pin
CCG325-May-07 8:04
CCG325-May-07 8:04 
QuestionStringBuilder huge string concatenation Pin
K.P.Kannan25-May-07 4:18
K.P.Kannan25-May-07 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.