This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


List event handler functions associated with COM object events


info = eventlisteners(c)



info = eventlisteners(c) lists the events and their event handler routines registered with a COM object. You can register events either when you create the control using actxcontrol, or after creating the control using registerevent.


collapse all

Create an mwsamp control and add an event handler function named myclick to the Click event.

f = figure('position',[100 200 200 200]);
C = actxcontrol('mwsamp.mwsampctrl.2',[0 0 200 200],f,{'Click' 'myclick'});
ans = 'Click'    'myclick'

Register handlers for two more events, DblClick and MouseDown.

registerevent(C,{'DblClick', 'my2click'; 'MouseDown' 'mymoused'})
ans = 
    'Click'        'myclick' 
    'Dblclick'     'my2click'
    'Mousedown'    'mymoused'

Input Arguments

collapse all

COM object, specified as a function handle.

Output Arguments

collapse all

List of event handler functions, returned as a cell array of character vectors. Each row contains the name of a registered event and the handler routine for that event. If the object has no registered events, eventlisteners returns an empty cell array.


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

Introduced before R2006a