method ListBar.BeginUpdate ()
Maintains performance when items are added to the control one at a time.

 TypeDescription 
Use the BeginUpdate and EndUpdate methods to maintain performance while adding multiple groups and items. Use the Add method to add a new group to the control. Use the AddItem method to add new items to the group.

The following VB sample adds a group and two items:

With ListBar1
    .BeginUpdate
    With .Groups.Add("Group 1")
        .AddItem "Item 1"
        .AddItem "Item 2"
    End With
    .EndUpdate
End With

The following C++ sample adds a group and two items:

#include "Item.h"
#include "Group.h"
#include "Groups.h"
m_listbar.BeginUpdate();
COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR;
CGroups groups = m_listbar.GetGroups();
CGroup group = groups.Add("Group 1");
group.AddItem( "Item 1", vtMissing );
group.AddItem( "Item 2", vtMissing );
m_listbar.EndUpdate();

The following VB.NET sample adds a group and two items:

With AxListBar1
    .BeginUpdate()
    With .Groups.Add("Group 1")
        .AddItem("Item 1")
        .AddItem("Item 2")
    End With
    .EndUpdate()
End With

The following C# sample adds a group and two items:

axListBar1.BeginUpdate();
EXLISTBARLib.Group group = axListBar1.Groups.Add("Group 1");
group.AddItem("Item 1", null);
group.AddItem("Item 2", null);
axListBar1.EndUpdate();

The following VFP sample adds a group and two items:

With thisform.ListBar1
    .BeginUpdate()
    With .Groups.Add("Group 1")
        .AddItem("Item 1")
        .AddItem("Item 2")
    EndWith
    .EndUpdate()
EndWith

Send comments on this topic.
1999-2015 Exontrol.COM, Software. All rights reserved.