Back to Devexpress

BaseLayoutItem.Update() Method

windowsforms-devexpress-dot-xtralayout-dot-baselayoutitem-3cc06b5d.md

latest2.2 KB
Original Source

BaseLayoutItem.Update() Method

Updates the region occupied by the layout item.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual void Update()
vb
Public Overridable Sub Update

Remarks

This method updates the region occupied by the current layout item, and the control the layout item contains.

Example

Consider an example where a layout item contains a ProgressBarControl and the ProgressBarControl’s position is displayed within the item’s text region. The ProgressBarControl is used to display the progress of a lengthy operation. The layout item and the control must be manually updated during the operation after each progress step. Otherwise, they will only be updated after the operation is completed. To update the layout item and the control it contains, the BaseLayoutItem.Update method is called.

csharp
using System.Threading;

for (int i = 0; i < 1000; i++) {                
    layoutControlItem1.Text = i.ToString();
    progressBarControl1.Position = i;
    // Update the layout item and its control.
    layoutControlItem1.Update();
    // Imitate a lengthy operation.
    Thread.Sleep(100); 
    //...
}
vb
Imports System.Threading

For i As Integer = 0 To 999
    layoutControlItem1.Text = i.ToString()
    progressBarControl1.Position = i
    ' Update the layout item and its control.
    layoutControlItem1.Update()
    ' Imitate a lengthy operation.
    Thread.Sleep(100)
    '...
Next i

See Also

BaseLayoutItem Class

BaseLayoutItem Members

DevExpress.XtraLayout Namespace