xtd 0.2.0
Loading...
Searching...
No Matches

◆ begin_update()

void xtd::forms::choice::begin_update ( )

Maintains performance while items are added to the choice one at a time by preventing the control from drawing until the EndUpdate() method is called.

Remarks
The preferred way to add multiple items to the choice is to use the push_back_range method of the choice::object_collection class (through the items property of the choice). This enables you to add an array of items to the list in a single operation. However, if you want to add items one at a time using the Add method of the choice::object_collection class, you can use the begin_update method to prevent the control from repainting the choice each time an item is added to the list. Once you have completed the task of adding items to the list, call the end_update method to enable the choice to repaint. This way of adding items can prevent flickered drawing of the choice when a large number of items are being added to the list.