dynamically created User Control performance

07/20/2017 08:15 Buckyx#1
I dynamically create user control which is like 40 buttons and each has 75x75 image as background, it takes a while to show. images are embedded resource

would I gain some performance if I created that User Control manually in VS and just inserted in code instead of generating one button after another and loading images?

number of controls like this can scale with time to higher numbers
07/20/2017 09:12 Ludder231#2
you could try to load the images from disk. i don't see why it should take so long...
07/20/2017 20:25 Underfisk#3
It's a common render problem, its not about the loading at all.
You must do one thing that usually i do at work and most of .Net framework programmer do, just create a loading and just show the form after it being loaded.
Otherwise just check any fast render API or optimizate your code at max.
08/03/2017 23:03 Epanias#4
You could as well use async / await to render the buttons one by one and show them in a row so you can use the first ones already while the rest is still loading, if you don't have to show them all at once.