Super slow C# custom control

后端 未结 7 703
猫巷女王i
猫巷女王i 2020-12-21 16:32

I\'ve made a custom control, it\'s a FlowLayoutPanel, into which I put a bunch of other custom controls (just Buttons, each with three Labels and a PictureBox overlayed)

7条回答
  •  死守一世寂寞
    2020-12-21 16:45

    The layout logic required for 5k controls will be too much for any type of wrapping panel. You might want to look into a different type of control designed the hold thousands of entries - something like a DataGridView.

    The DataGridView has several different column types available that should work for the type of data you're displaying (images, buttons, labels). Since your database query looks to return a DataTable, you could simply bind that directly to your DataGridView and remove the loop.

提交回复
热议问题