c# - Defer form updates -


Is there a way to postpone a form by updating / restoring while manipulating controls?

I am using

TableLayoutPanel to control my form, and I want to add / remove individual user controls dynamically in different cells of the table on the runtime.

When I do this, the screen update is very slow, and some are blinking.

  tablelayout.SuspendLayout ()  

SuspendLayout () seems to have no effect.

It depends on the control; Look for BeginUpdate / EndUpdate or BeginEdit / EndEdit , etc. (and try them try / ultimately blocks). Note, however, there are only these methods in some controls, and they are not bound to an easy interface, so this is a little manual. For example:

  listView.BegginUpdate (); Try {{int i = 0; i & lt; 100; i ++} {listView.Items.Add ("item" + i); }} Finally {listView.EndUpdate (); }  

Note that data-bound controls may have other mechanisms to disable data-related changes; For example, the binding list has a settable RaiseListChangedEvents , which lets you turn off notifications when you edit the data, you can see things like "virtual mode."


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -