Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBox.BulkUpdate Property

Defines bulk update mode.

Syntax

Get

VB.NETBoolean = object.BulkUpdate As Boolean
VBBoolean = object.BulkUpdate As Boolean
C#.NETbool Boolean = object.BulkUpdate;
VC++VARIANT_BOOL Boolean = object->BulkUpdate; VARIANT_BOOL Boolean = object->GetBulkUpdate();
CHRESULT object->get_BulkUpdate(VARIANT_BOOL* Boolean);

Put

VB.NETobject.BulkUpdate = Boolean As Boolean
VBobject.BulkUpdate = Boolean As Boolean
C#.NETbool object.BulkUpdate = Boolean;
VC++VARIANT_BOOL object->BulkUpdate = Boolean;
void object->PutBulkUpdate(VARIANT_BOOL Boolean);
CHRESULT object->put_BulkUpdate(VARIANT_BOOL Boolean);

object

A SftBox object.

Boolean

Defines bulk update mode.

BooleanDescription
TrueA mass-update is in progress.
FalseA mass-update has ended.

Comments

The BulkUpdate property defines bulk update mode.

The BulkUpdate property should be used when many items are added to a control or other lengthy operations are performed. By setting the property to True, the control can skip certain internal processing. Once updates are completed, the property has to be set to False. When adding, inserting or deleting items or when changing the Item.Level property, the control may have to do an extensive scan of parent items to determine if the current (visual) presentation has to be changed. This processing can be skipped when the BulkUpdate property is set to True, considerably speeding up the process.

After updating the control, the BulkUpdate property must be set to False. If the property remains set to True, the control will no longer redraw itself properly. The property should be set to True once, before adding many items and later set to False once, after all items have been added. Repeatedly setting the property to True and False while adding items significantly decreases the control's performance.

This property is not available at design-time.

Examples

VB.NET

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ' add all font information
    UpdateFontNames()
End Sub

Private Sub UpdateFontNames()
    ' add all font names
    fontNames.BulkUpdate = True
    fontNames.Items.Clear()
    fontNames.Items.AddFontNames(-1, SftBoxFontConstants.fontSftBoxAll, True, 0)
    fontNames.Items.Selection = 0
    PerformSort(fontNames, SftBoxSortConstants.sortSftBoxAscending)
    fontNames.BulkUpdate = False
    fontNames.Columns.MakeOptimal(0)
    fontNames.Items.RecalcHorizontalExtent(0)
End Sub

VB6

        SftBoxCtrl.Items.Sort -1, 0, sortSftBoxAscending
    Else
        SftBoxCtrl.Items.Sort -1, 0, sortSftBoxDescending
    End If
End Sub

Private Sub UpdateFontNames()
    ' add all font names
    FontNames.BulkUpdate = True
    FontNames.Items.Clear
    FontNames.Items.AddFontNames -1, fontSftBoxAll, True, 0
    FontNames.Items.Selection = 0
    PerformSort FontNames
    FontNames.BulkUpdate = False
    FontNames.Columns.MakeOptimal 0
    FontNames.Items.RecalcHorizontalExtent 0

C#

{
    // add all font information
    UpdateFontNames();
}

private void UpdateFontNames()
{
    // add all font names
    fontNames.BulkUpdate = true;
    fontNames.Items.Clear();
    fontNames.Items.AddFontNames(-1, SftBoxFontConstants.fontSftBoxAll, true, 0);
    fontNames.Items.Selection = 0;
    PerformSort(fontNames, SftBoxSortConstants.sortSftBoxAscending);
    fontNames.BulkUpdate = false;
    fontNames.Columns.MakeOptimal(0);
    fontNames.Items.RecalcHorizontalExtent(0);

C++

    return TRUE;  // return TRUE  unless you set the focus to a control
}

void CFontDlgDlg::UpdateFontNames()
{
    // add all font names
    ISftBoxPtr vFontNames = m_FontNames.GetControlUnknown();

    vFontNames->BulkUpdate = VARIANT_TRUE;
    vFontNames->Items->Clear();
    vFontNames->Items->AddFontNames(-1, fontSftBoxAll, VARIANT_TRUE, 0);
    vFontNames->Items->Selection = 0;
    PerformSort(vFontNames, sortSftBoxAscending);
    vFontNames->BulkUpdate = VARIANT_FALSE;
    vFontNames->Columns->MakeOptimal(0);
    vFontNames->Items->RecalcHorizontalExtent(0);

See Also SftBox Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.