LayoutControl.Refresh() Method

Updates the layout control.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v21.2.dll

Declaration

public override void Refresh()

Remarks

The Refresh method recalculates all the graphical information of the layout control and then redraws it.

Example

The following code custom paints a label embedded in the LayoutControl. This label displays the count variable’s value. When the count changes, call the LayoutControl.Refresh method to redraw the label (fire the BaseLayoutItem.CustomDraw event).

LayoutControl-Refresh.gif

int count = 0;
Font myFont = new Font("Tahoma", 12, FontStyle.Bold);
private void simpleLabelItem1_CustomDraw(object sender, DevExpress.XtraLayout.ItemCustomDrawEventArgs e) {
    e.Cache.DrawString("COUNT=" + count.ToString(), myFont, Brushes.Blue, e.Bounds);
    e.Handled = true;
}

private void button1_Click(object sender, EventArgs e) {
    count++;
    layoutControl1.Refresh();
}
See Also