| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
tf = h.isevent('eventname')
tf = isevent(h, 'eventname')
tf = h.isevent('eventname') returns logical 1 (true) if event_name is an event recognized by COM object h. Otherwise, returns logical 0 (false). The event_name argument is not case sensitive.
tf = isevent(h, 'eventname') is an alternate syntax.
COM functions are available on Microsoft Windows systems only.
Test events in a MATLAB sample control object:
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);
h.isevent('DblClick')MATLAB displays true, indicating DblClick is an event.
Try the same test onRedraw:
h.isevent('Redraw')MATLAB displays false, indicating Redraw is not an event; it is a method.
Test events in a Microsoft Excel workbook object:
Create a Workbook object wb:
myApp = actxserver('Excel.Application');
wbs = myApp.Workbooks;
wb = wbs.Add;Test Activate:
wb.isevent('Activate')MATLAB displays true, indicating Activate is an event.
Test Save:
wb.isevent('Save')MATLAB displays false, indicating Save is not an event; it is a method.
eventlisteners | events (COM) | registerevent
![]() | isequalwithequalnans | isfield | ![]() |

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 |