Method Replace
Replace(Control, Control, bool)
Detaches the given oldControl from the sizer and replaces it
with the given newControl.
bool Replace(Control oldControl, Control newControl, bool recursive)
Parameters
oldControlControlOld control.
newControlControlNew control.
recursiveboolWhether to to search the given element recursively in subsizers
Returns
- bool
trueif operation is successful;falseotherwise.
Remarks
The detached child control is not deleted (because controls are owned by their parent control, not the sizer).
Replace(ISizer, ISizer, bool)
Detaches the given oldsz from the sizer and replaces it
with the given newsz.
bool Replace(ISizer oldsz, ISizer newsz, bool recursive)
Parameters
oldszISizerOld sizer item.
newszISizerNew sizer item.
recursiveboolWhether to to search the given element recursively in subsizers
Returns
- bool
trueif operation is successful;falseotherwise.
Remarks
The detached child sizer is deleted.
Replace(int, ISizerItem)
Replaces sizer item at the specified index.
bool Replace(int index, ISizerItem newitem)
Parameters
indexintItem index.
newitemISizerItemSizer item.
Returns
Remarks
This method does not cause any layout or resizing to take place, call Layout() to update the layout "on screen" after removing a child from the sizer.