Dynamic Windows Forms Components (Performance problem)

Posted by Svisstack on Stack Overflow See other posts from Stack Overflow or by Svisstack
Published on 2010-04-26T15:49:46Z Indexed on 2010/04/26 18:33 UTC
Read the original article Hit count: 333

Filed under:
|
|
|
|

I have a problem with performance of my code under Windows Forms. Have a form, her layout is depending on constructor data, because he layout must be OnLoad or in Constructor generated.

I generation is simple, base FlowLayoutPanel have other FlowLayoutPanels, for each have a Label and TextBox with DataBinding.

Problem is this is VERY SLOW, up to 20 seconds, i drawing less than 100 controls, from Performace Session i know a problem is on 70% procesing functions:

  1. System.Windows.Forms.Control.ControlCollection.Add(class System.Windows.Forms.Control)
  2. System.Windows.Forms.ControlBindingsCollection.Add(class System.Windows.Forms.Binding)

How i can do with this? Anyone help me in this problem? How solve the dynamic form layout problem?

© Stack Overflow or respective owner

Related posts about c#

Related posts about layout