G
Guest
Hi All,
I want to implement an 'generic' undo by placing a copy of a control in a
stack using System.Collections.Generic.Stack. Basically this way I don't need
to know if a user has edited text in tree, added or deleted a node etc,
added items to a list box etc etc. I just push the control onto the stack
when they change it (regardless of control type) and Pop if back if they undo.
My problem is how to a get a copy of the control? Obviosuly if I push the
control onto the stack, I get a reference to the original so every entry on
the stack is always the same, so I need to make a copy of the control that is
independant of the original.
Is there an *easy* way to do this - I've found a few examples, but they seem
dependant on knowing exactly what type of control it is, and wind through all
the properties etc, I was hoping for something more generic.
I am using VB.Net 2005.
Thanks in advance!
I want to implement an 'generic' undo by placing a copy of a control in a
stack using System.Collections.Generic.Stack. Basically this way I don't need
to know if a user has edited text in tree, added or deleted a node etc,
added items to a list box etc etc. I just push the control onto the stack
when they change it (regardless of control type) and Pop if back if they undo.
My problem is how to a get a copy of the control? Obviosuly if I push the
control onto the stack, I get a reference to the original so every entry on
the stack is always the same, so I need to make a copy of the control that is
independant of the original.
Is there an *easy* way to do this - I've found a few examples, but they seem
dependant on knowing exactly what type of control it is, and wind through all
the properties etc, I was hoping for something more generic.
I am using VB.Net 2005.
Thanks in advance!