Mar 6, 2009
My code is basically a file parser/editor and it handles most files fine as they hold a handful of records concerning family members. However there are a few files that crash when trying to deal with them. Here is the problem.Each family member record creates 3 tabs that hold an average of 3 group boxes each. Each group box holds an average of 3 text boxes.So each member record creates 3x3x3 = 27 text boxes and some files get up to 289 family members which = 7803 text boxes.
View 2 Replies
The problem is the rare file with 400+ member records = 10,800 text boxes which causes a crash due to using up all the window handles. Each member has a separate tab page (with 3 subpages) but really only a dozen or so member pages are visible in the GUI with scroll arrows to move through them so I was thinking of somehow making the GUI a scrollable window so the tabs get built, displayed and disposed as the user scrolls left and right through the member tabs.
The files are parsed into a 3d list DataList(x,y,z) where x is the page number, y is the group box number and z is the text box number. So all the data is available. The code then traverses MyList and builds GuiList(x,y) where x is the page number and y is the groupbox number with all the textbox.text linked to MyList(x,y,z) locations so all text changes are reflected in the MyList.
I already have a memberCount variable and I am thinking of building, say, the first 30 member tabs with the middle 10 being visible in the GUI. If the selected tab > 20, then dispose of the first 10 tabs and create tabs 30-40.I am thinking I will keep all the member tab pages so I don't have to deal with inserts and indexing problems but just dispose all the group boxes and text boxes for tab pages out of view. I already have a deep clone sub that clones members when the user wants to add a new family member and I am thinking I will have to add something similar when a tabpage is passed in for disposal, it traverses and disposes each text box, then disposes the group box for each group box on the tab page.Additionally, another routine will rebuild the group boxes from the data held in MyList(x,y,z) when a tabpage(x) is passed in.