Method DoInsideLayout
DoInsideLayout(Action, bool)
Executes action between calls to SuspendLayout()
and ResumeLayout(bool, bool).
public virtual void DoInsideLayout(Action action, bool layoutParent = true)
Parameters
actionActionAction that will be executed.
layoutParentboolSpecifies whether to call parent's PerformLayout(bool). Optional. By default is
true.
DoInsideLayout<T>(T, Action<T>, bool)
Executes the specified action within a layout suspension context, ensuring that layout updates are resumed afterward.
public virtual void DoInsideLayout<T>(T prm, Action<T> action, bool layoutParent = true)
Parameters
prmTThe parameter of type
Tto pass to theaction.actionAction<T>The action to execute. This action is provided with a parameter of type
T.layoutParentboolA value indicating whether the parent layout should also be resumed. The default value is true.
Type Parameters
TThe type of the parameter to be passed to the action.
Remarks
This method suspends layout updates before executing the specified action and ensures that layout updates are resumed afterward, even if the action throws an exception. Use this method to perform operations that temporarily modify the layout without triggering intermediate layout updates.