This is machine translation

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


Determine whether input is COM object event


tf = isevent(h,'eventname')


tf = isevent(h,'eventname') returns logical 1 (true) if eventname is an event recognized by COM object h. Otherwise, returns logical 0 (false). The eventname argument is not case-sensitive.

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


This example tests events in a MATLAB® sample control object.

  1. Create an instance of the mwsamp control and test DblClick.

    f = figure('position',[100 200 200 200]);
    h = actxcontrol('mwsamp.mwsampctrl.2',[0 0 200 200],f);

    MATLAB displays true, indicating DblClick is an event.

  2. Try the same test onRedraw.


    MATLAB displays false, indicating Redraw is not an event; it is a method.

Test events in a Microsoft Excel® workbook object.

  1. Create a Workbook object wb

    myApp = actxserver('Excel.Application');
    wbs = myApp.Workbooks;
    wb = Add(wbs);
  2. Test Activate.


    MATLAB displays true, indicating Activate is an event.

  3. Test Save


    MATLAB displays false, indicating Save is not an event; it is a method.

Introduced before R2006a

Was this topic helpful?