I have a huge problem with my planning application. I have create an application that shows the planning for an employee. To do so, I created an object 'Planningline', with a panel on it. In this panel, I add colored blocks to show the planning with the function myPanel.Controls.Add( myBlock). For each employee, I add such a planningline in another panel, and this is shown on the screen.
This works, but it seems that after a while the system runs out of object or memory. I show about 100 lines, and they have a function to 'refresh' the form, which re-creates all objects. Before I do this, I added a this code to clear the memory:
dim myControl as control
for each control in myPanel.Controls
myControl = Nothing
This is done for all panels: there is a loop for the 'planningline' objects, and for every planningline object this is done again for the panel on this object.
However, this doesn't seem to work, after a few 'refresh' actions the system stops drawing objects, and I cannot even access the menu anymore. The only solution is to restart the program.
I also use a datasource to find the employees, but this datasource is defined as a local variable. Could this be the problem ?