dotnetmonitor.com |
|
||||||||||||
| Problem: Changing properties such as
Bounds, Size, Location, Visible and Text/Image/etc for AutoSized controls
InitializeComponent and/or Suspend/ResumeLayout can cause perf problems. Each
time one of these properties are touched a layout is forced. Changing any of these
in Form.Load is particularly bad, at that point the handles have all been
created, and window messages have to be sent to change size/locations.
Solution: Add a Suspend/Resume Layout to prevent extra layouts from occurring. If possible, make all of these changes within InitializeComponent this way only one layout is ever needed |
||||||||||||
|
||||||||||||