Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a huge form with large number of Controls in a TabControl having 20 Tabs.. In run time its using huge memory, and User Objects gets exceeded its limit of 10000 while opening all the tab pages. i want to dispose last used tab each time while changing the tab, but there is a problem we can't reopen a dispose tab..

What I have tried:

i have tried User Control Container to partially loading of form controls but its not worthy...
Posted
Updated 23-Jun-17 19:32pm

1 solution

You cannot re-open Disposed class instances: the resources they rely upon have been recycled. Trying to is like dismantling a table, using the legs as firewood and the top as a door, then trying to serve dinner on it! That won't work: once the table has been recycled, you need to buy a new one.
Which is what who need to do with your tab pages: create new instances as needed.

But honestly, I think your UI design is badly flawed: I doubt very much that any user is going to want to look at 10,000 controls, let alone wait for your app to start up - which will probably take considerable time with that much to display - I certainly wouldn't!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900