15,913,836 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12602897 (Top 4 by date)
Member 12602897
30-Aug-23 10:46am
View
Thank you, thank you, thank you - I was going crazy trying everything but missed that one.
Member 12602897
29-Aug-23 17:59pm
View
In playing with it, I find that when I delete/undo an entry, then add another one, the entry count is the correct number (minus one - plus one). So the process of adding entries and deleting them is working correctly. The problem is that when returning the last entry it only returns the last ADDED one, no matter how many are deleted. It seems I am getting a left-over entry from the add process from somewhere, but not the one at the end of the collection.
Member 12602897
29-Aug-23 13:51pm
View
For the add process an entry is added each time the button is clicked, each entry with a sequential number to make them all different. Teh debugger shows those fields as they are added.
Within the Undo process each time the button is clicked the debugger shows the return for the count of entries in the collection has been correctly decremented, but the data returned for the index (count - 1) is always the same last entry, even though that entry should have been deleted. The debugger shows that the items returned have the data from the last entry that had been added to the collection.
Member 12602897
29-Aug-23 10:57am
View
The return info is in the display field on the form. Each time the btnUndo is clicked it should display the last entry in the collection, then delete/remove that last entry. The next time it is clicked it should show a different / previous last entry. It does not!
I have tried displaying the individual entries from the collection instead of using the "tostring" override, with the same results. I don't know how to look at the data within the collection class itself without accessing an entry and looking at the individual fields in the entry class. Every time I access what should be the last entry in the collection class it appears to be the same data as the original last entry.