Skip to main content

TdxLayoutContainer.BeginUpdate Method

Disables refresh operations on the layout control.

Declaration

procedure BeginUpdate;

Remarks

Calling the BeginUpdate method disables layout control repainting. If the BeginUpdate procedure has been called, any changes to groups (or items) are not refreshed until calling the EndUpdate (CancelUpdate) method. The BeginUpdate and EndUpdate (CancelUpdate) methods work together to prevent numerous updates of the layout control when adding groups, items or regrouping.

Remember to call the EndUpdate (CancelUpdate) method after calling BeginUpdate. Every call of the BeginUpdate method increases the internal counter by one. Every call of the EndUpdate (CancelUpdate) method decreases this counter by one. The layout control can refresh itself only when the internal counter is 0. Assume you need to add several items programmatically. If you do not use the BeginUpdate and EndUpdate (CancelUpdate) methods, the layout control redraws itself as many times as the number of added items. Instead of prolonged delays, you can use the BeginUpdate method before adding the first item and the EndUpdate method after adding the last item; so the control redraws itself only once.

See Also