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
oldControl
ControlOld control.
newControl
ControlNew control.
recursive
boolWhether to to search the given element recursively in subsizers
Returns
- bool
true
if operation is successful;false
otherwise.
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
oldsz
ISizerOld sizer item.
newsz
ISizerNew sizer item.
recursive
boolWhether to to search the given element recursively in subsizers
Returns
- bool
true
if operation is successful;false
otherwise.
Remarks
The detached child sizer is deleted.
Replace(int, ISizerItem)
Replaces sizer item at the specified index.
bool Replace(int index, ISizerItem newitem)
Parameters
index
intItem index.
newitem
ISizerItemSizer 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.