Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

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
    

    MATLAB displays:

    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
    

    MATLAB displays:

    ans = 
         {}
    

See Also

eventlisteners | events (COM) | isevent | registerevent | unregisterevent

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS