Remove Method - Controls

Removes the specified control from the current form's Controls collection.

App.ActiveForm.Controls.Remove(Ctrl)

Client support

   Newlook Smartclient

   Newlook Server

Parameters

Ctr – (Object, Required)

The control to be removed. It is possible to reference a control by either its name or its index in the controls collection.

Returns

Returns a Boolean indicating the success or failure of the action.

Examples

The following code will remove an inserted label from the controls collection:

J SCRIPT

function RemoveWarningByName()

{

//Remove inserted Warning label control using its name

removeSuccess = App.ActiveForm.Controls.Remove(lbWarning);

App.SetValue("RemoveSuccess", removeSuccess);

}

function RemoveWarningByIndex()

{

//Remove inserted Warning label using its index

var warningIndex = App.ActiveForm.Controls.lbWarning.FormControlsCollectionIndex;

removeSuccess = App.ActiveForm.Controls.Remove(App.ActiveForm.Controls(warningIndex));

App.SetValue("RemoveSuccess", removeSuccess);

}

 

VB SCRIPT

Sub RemoveWarningLabel

'Remove warning label using its name.

App.ActiveForm.Controls.Remove App.ActiveForm.Controls.lbWarning

End Sub

See Also

Add Method - Controls | RefreshForm method | Remove Method - Function Keys | Remove Method - Items | Remove Method - Nodes | Remove Method - Columns Headers

Applies To

Controls collection

FunctionKey collection

ListView ListItems collection

ListView ColumnHeaders collection

TreeView Nodes collection


© 2004-2021 looksoftware. All rights reserved.