ExecuteAction(DesignerAction) Method
Executes the specified
DesignerAction command within the designer environment.
'Declaration
Public Overloads Sub ExecuteAction( _
ByVal As DesignerAction _
)
Parameters
- action
- The DesignerAction to be executed. This action corresponds to various design-time operations such as adding new controls, deleting controls, or changing properties.
// The following example demonstrates how to remove selected items from the designer surface by executing the EditDelete action:
private void RemoveSelectedItems()
{
designer.ExecuteAction(DesignerAction.EditDelete);
}
// You can also clear the designer surface by selecting all items and deleting them
private void Clear()
{
designer.ExecuteAction(DesignerAction.SelectAll);
designer.ExecuteAction(DesignerAction.EditDelete);
}