CommandEventArgs.Create

Syntax

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

Parameters

Command - name of the command that should be sent.

Argument - value of the command argument.

Result - result of command execution.

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 positioned 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", 3, Null);

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 Square command is passed as a parameter, the argument of command is 3. The result of command execution is displayed in the development environment console.

See also:

CommandEventArgs