Hello everyone
I have a stack of buttons creating at runtime and I would like to copy all it's elements to another stack, before I pop items of the initial stack without affecting the ResultStack.
Dim InitialStack, CopiedStack As Stack(Of Button)
InitialStack = New Stack(Of Button)
InitialStack.Push(btn1)
InitialStack.Push(btn2)
InitialStack.Push(btn3)
'btn1, btn2, btn3 are examples, in reallity the stack takes elements during runtime.
CopiedStack = New Stack(Of Button)
CopiedStack = InitialStack
InitialStack.Pop()
if I say that btn3 is poped of both stacks too.
The what I want to do is to pop the peek item of InitialStack, without affect CopiedStack
Any ideas please? Any help will be much appreciated.
Thank you so much
in advanced.
I have a stack of buttons creating at runtime and I would like to copy all it's elements to another stack, before I pop items of the initial stack without affecting the ResultStack.
Dim InitialStack, CopiedStack As Stack(Of Button)
InitialStack = New Stack(Of Button)
InitialStack.Push(btn1)
InitialStack.Push(btn2)
InitialStack.Push(btn3)
'btn1, btn2, btn3 are examples, in reallity the stack takes elements during runtime.
CopiedStack = New Stack(Of Button)
CopiedStack = InitialStack
InitialStack.Pop()
if I say that btn3 is poped of both stacks too.
The what I want to do is to pop the peek item of InitialStack, without affect CopiedStack
Any ideas please? Any help will be much appreciated.
Thank you so much
in advanced.