IMouseEventArgs.Cancel

Syntax

Cancel: Boolean;

Description

The Cancel property determines whether the next action related with mouse is canceled.

Comments

The property is used in the events related with a click or double-click (OnClick and OnDblClick), and does not affect the actions related with cursor move. The Cancel property can be used, for example, to cancel a click or double-click on a component, depending on specific form execution conditions or the current state of other components.

Available values:

Example

Executing the example requires a form with the MetabaseTreeList component named MetabaseTreeList1 and the MetabaseListView component named MetabaseListView1. MetabaseTreeList1 is set as a value of the Tree property of the MetabaseListView1 component.

The specified procedure is a handler of the OnDblClick event of the MetabaseListView1 component.

Sub MetabaseListView1OnDblClick(Sender: Object; Args: IMouseEventArgs);
Var
    MDesc: IMetabaseObjectDescriptor;
Begin
    MDesc := (MetabaseListView1.SelectedItem 
As IMetabaseListViewItem).ObjectDescriptor;
    
If (MDesc.ClassId=MetabaseObjectClass.KE_CLASS_MODULE) Or (MDesc.ClassId=MetabaseObjectClass.KE_CLASS_ASSEMBLY) Then
        Args.Cancel := 
True;
    
End If;
End Sub MetabaseListView1OnDblClick;

On executing the example, if a unit or assembly is double-clicked during navigation in a component tree in the MetabaseListView1 component, their opening in the development environment is denied.

See also:

IMouseEventArgs