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, the form resize gets slow on runtime.
What’s the problem with dock and anchor options?
Is it a general problem with forms? Is it a general disadvantage of using .net components and windows forms?
I don’t have any custom events handled on control resize, so the problem is about the controls Microsoft developed. Should I avoid using dock=fill?
It’s a normal that it consumes your processor as on every resize move
formforms resizetable layout panelwhich forces resize and reposition child controls (dropdowns), as there isanchorproperty setuped.There is a trick to avoid to create a frustration for user when resizing:
Use
SuspendLayout()andResumeLayout()onBeginResize()andEndResize()event handlers.Look here for concrete example:
Prevent window redraw when resizing c# windows forms
Should work for you.