Windows Forms: using BackgroundImage slows down drawing of the Form's controls

后端 未结 6 1583
终归单人心
终归单人心 2020-12-08 02:33

I have a Windows Form (C# .NET 3.5) with a number of buttons and other controls on it, all assigned to a topmost Panel which spans the whole Form. For example, the hierarchy

6条回答
  •  不思量自难忘°
    2020-12-08 03:21

    For me, the post Form load is slow if adding a background image solved the problem:

    Make sure your backgroundcolor is not set to 'transparent'. Set it to 'white' for better performance.

    Also, do BackgroundImageLayout to be either 'Center' or 'Stretch' to increase performance. This will enable the double buffer on the form.

提交回复
热议问题