Search code examples
c#objectcreation

C# Object Creation Takes Time


I need to create about 720 buttons or labels in my application during run time. The problem here is when I start my app or make it (re-)visible, I can see that buttons being loaded.

How can I avoid from it or make it faster?


Solution

  • The best way is to use Control.SuspendLayout Method before you've started to fill your control with buttons and than Control.ResumeLayout after you finished