Ribbon for WinForms
BeginUpdate メソッド (RibbonItemCollectionBase)
使用例 

C1.Win.Ribbon.4.5.2 アセンブリ > C1.Win.Ribbon 名前空間 > RibbonItemCollectionBase クラス : BeginUpdate メソッド
Maintains performance while items are being added or removed from the collection.
シンタックス
'宣言
 
Public Sub BeginUpdate() 
public void BeginUpdate()
解説

When adding a large number of items to the collection, you should use the BeginUpdate method to prevent the collection from updating its internal state 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 resume regular processing.

This way of adding items dramatically improves performance and is recommended when adding more than 10 or 20 items to the list.

使用例

The code belows populates a RibbonComboBox with items containing the names of all the fonts installed in the system.

You can run the sample as-is, then comment out the calls to BeginUpdate and EndUpdate to see the difference in performance.

// get collection to populate
RibbonItemCollection items = fontNameComboBox.Items;
            
// call BeginUpdate to suspend regular processing
items.BeginUpdate();
            
// populate the list
InstalledFontCollection ifc = new InstalledFontCollection();
foreach (FontFamily ff in ifc.Families)
{
    items.Add(new RibbonButton(ff.Name));
}
            
// resume regular processing
items.EndUpdate();
参照

RibbonItemCollectionBase クラス
RibbonItemCollectionBase メンバ