Table of Contents

Method Replace

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

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 Control

Old control.

newControl Control

New control.

recursive bool

Whether 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 ISizer

Old sizer item.

newsz ISizer

New sizer item.

recursive bool

Whether 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 int

Item index.

newitem ISizerItem

Sizer item.

Returns

bool

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.