corelibraries-devexpress-dot-utils-dot-commands-dot-command.md
Executes the command on the current command target.
Namespace : DevExpress.Utils.Commands
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public virtual void Execute()
Public Overridable Sub Execute
The Execute method checks the command state before executing, and decides whether the action can be performed. In case you want to execute an action if the command cannot be executed, use the Command.ForceExecute method.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Execute() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
MessageBox.Show("Custom command executed");
base.Execute();
}
winforms-richedit-table-of-contents-practical-guide/CS/Form1.cs#L24
private void btnShowAllFieldCodes_Click(object sender, EventArgs e) {
new ShowAllFieldCodesCommand(richEditControl1).Execute();
}
how-to-custom-draw-in-pdf-viewer/CS/PDF_Viewer/Form1.cs#L30
{
base.Execute();
return;
MessageBox.Show("Custom command executed")
MyBase.Execute()
End Sub
winforms-richedit-table-of-contents-practical-guide/VB/Form1.vb#L32
Private Sub btnShowAllFieldCodes_Click(ByVal sender As Object, ByVal e As EventArgs)
Call New ShowAllFieldCodesCommand(richEditControl1).Execute()
End Sub
how-to-custom-draw-in-pdf-viewer/VB/PDF_Viewer/Form1.vb#L30
If rectangles Is Nothing OrElse rectangles.Count = 0 Then
MyBase.Execute()
Return
See Also