windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-509648f9.md
Updates the layout control.
Namespace : DevExpress.XtraLayout
Assembly : DevExpress.XtraLayout.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public override void Refresh()
Public Overrides Sub Refresh
The Refresh method recalculates all the graphical information of the layout control and then redraws it.
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();
}
Dim count As Integer = 0
Dim myFont As New Font("Tahoma", 12, FontStyle.Bold)
Private Sub SimpleLabelItem1_CustomDraw(sender As Object, e As DevExpress.XtraLayout.ItemCustomDrawEventArgs) Handles SimpleLabelItem1.CustomDraw
e.Cache.DrawString("COUNT=" + count.ToString(), myFont, Brushes.Blue, e.Bounds)
e.Handled = True
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
count = count + 1
layoutControl1.Refresh()
End Sub
See Also