ToolStripComboBox.BeginUpdate Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Maintains performance when items are added to the ToolStripComboBox one at a time.
public:
void BeginUpdate();
public void BeginUpdate ();
member this.BeginUpdate : unit -> unit
Public Sub BeginUpdate ()
Remarks
This method prevents the control from painting until the EndUpdate method is called.
The preferred way to add items to the ToolStripComboBox is to use the AddRange method through the Items property of the 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 Add method, you can use the BeginUpdate method to prevent the control from repainting the ToolStripComboBox each time an item is added to the list. Once you have completed the task of adding items to the list, call the EndUpdate method to enable the ToolStripComboBox to repaint. This way of adding items can prevent flicker during the drawing of the ToolStripComboBox when a large number of items are being added to the list.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應