Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

LayoutControl.Refresh() Method

Updates the layout control.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#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).

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