System.Windows.Forms.ToolStripComboBox.BeginUpdate Method

Maintains performance when items are added to the System.Windows.Forms.ToolStripComboBox one at a time.

Syntax

public void BeginUpdate ()

Remarks

This method prevents the control from painting until the ToolStripComboBox.EndUpdate method is called.

The preferred way to add items to the System.Windows.Forms.ToolStripComboBox is to use the ToolStripItemCollection.AddRange(ToolStripItemCollection) method through the ToolStripComboBox.Items property of the System.Windows.Forms.ToolStripComboBox. This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the erload:System.Windows.Forms.ToolStripItemCollection.Add method, you can use the ToolStripComboBox.BeginUpdate method to prevent the control from repainting the System.Windows.Forms.ToolStripComboBox each time an item is added to the list. Once you have completed the task of adding items to the list, call the ToolStripComboBox.EndUpdate method to enable the System.Windows.Forms.ToolStripComboBox to repaint. This way of adding items can prevent flicker during the drawing of the System.Windows.Forms.ToolStripComboBox when a large number of items are being added to the list.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0