CommandEventArgs.Create

Syntax

Create(Command: String; Argument: Variant; Result: Variant);

Parameters

Command. Name of the command to be sent.

Argument. Command argument value.

Result. Command execution result.

Description

The Create constructor creates an argument of the event that occurs when a command is sent to the form.

Example

Executing the example requires a form and a button named Button1 on it. The form has a handler of the OnCommand event, this handler contains a code for the Square command execution.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Argument: CommandEventArgs;
Begin
    Argument := New CommandEventArgs.Create("Square"3Null);
    Self.OnCommand(Self, Argument);
    Debug.WriteLine(Argument.Result);
End Sub Button1OnClick;

After executing the example pressing the button generates the OnCommand event for the current form. The specified command and command argument are passed as a parameter. The result of command execution is displayed in the development environment console.

See also:

CommandEventArgs