I have a WinForms performance issue that may be related to what I dynamically add and then remove hundreds of controls.
EDIT {The
application displays a timeline consisting of controls representing historical events. Controls are added, deleted, or moved depending on the transition time. Performance problems are associated not only with adding and removing controls (I can live with this), but even after I switch to time without any historical events (this means that the controls are not currently displayed). After jumping and getting time when there are no events on the chart, some actions in the graphical interface still take a lot of time, for example, opening a menu or opening dialog boxes. It is strange that other actions with a graphical interface, such as pressing buttons, do not stop. }
Despite the fact that the memory consumption is completely stable, can there be a problem with the release of resources?
To remove a control, I do two things:
- Unregister callbacks from all events,
- Challenge
containerPanel.Controls.Remove(control).
Thank!
source
share