This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


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




unregisterallevents(h) 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.

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


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'});
    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.

    ans = 

Introduced before R2006a

Was this topic helpful?