Documentation Center

  • Trial Software
  • Product Updates

Contents

unregisterallevents

Unregister all event handlers associated with COM object events at run time

Syntax

h.unregisterallevents
unregisterallevents(h)

Description

h.unregisterallevents unregisters all events previously registered with COM object h. After calling unregisterallevents, the object no longer responds to any events until you register them again using the registerevent function.

unregisterallevents(h) is an alternate syntax.

COM functions are available on Microsoft® Windows® systems only.

Examples

Register and unregister events for an instance of the mwsamp control, using the eventlisteners function to see the event handler associated with each event:

  1. Register three events and their respective handler routines.

    f = figure ('position', [100 200 200 200]);
    h = actxcontrol('mwsamp.mwsampctrl.2', ...
        [0 0 200 200], f, ... 
        {'Click' 'myclick'; 'DblClick' 'my2click'; ... 
        'MouseDown' 'mymoused'});
    h.eventlisteners
    
    ans = 
        'click'        'myclick' 
        'dblclick'     'my2click'
        'mousedown'    'mymoused'
    
  2. Unregister all events simultaneously with unregisterallevents. eventlisteners returns an empty cell array, indicating that there are no longer any events registered with the control:

    h.unregisterallevents;
    h.eventlisteners
    
    ans = 
         {}
    

See Also

| | | |

Was this topic helpful?