Slowness in C#.net windows form resize when form has many dropdownlist controls

后端 未结 1 341
鱼传尺愫
鱼传尺愫 2021-01-01 04:21

I made a windows form with many dropdown list which are placed inside a grid(not a datagrid) and when I use anchor=left right top bottom and dock=fill options in all of them

相关标签:
1条回答
  • 2021-01-01 04:38

    It's a normal that it consumes your processor as on every resize move form forms resize table layout panel which forces resize and reposition child controls (dropdowns), as there is anchor property setuped.

    There is a trick to avoid to create a frustration for user when resizing:

    Use SuspendLayout() and ResumeLayout() on BeginResize() and EndResize() event handlers.

    Look here for concrete example:

    Prevent window redraw when resizing c# windows forms

    Should work for you.

    0 讨论(0)
提交回复
热议问题