| MATLAB Function Reference | ![]() |
tf = h.isevent('name')
tf = isevent(h, 'name')
tf = h.isevent('name') returns logical 1 (true) if the specified name is an event that can be recognized and responded to by COM object h. Otherwise, isevent returns logical 0 (false) .
tf = isevent(h, 'name') is an alternate syntax for the same operation.
The string specified in the name argument is not case sensitive.
For COM control objects, isevent returns the same value regardless of whether the specified event is registered with the control or not. In order for the control to respond to the event, you must first register the event using either actxcontrol or registerevent.
Create an mwsamp control and test to see if DblClick is an event recognized by the control.
f = figure ('position', [100 200 200 200]);
h = actxcontrol ('mwsamp.mwsampctrl.2', [0 0 200 200], f);
h.isevent('DblClick')MATLAB® displays ans = 1 (true), showing that DblClick is an event.
Try the same test on Redraw, which is one of the control's methods.
h.isevent('Redraw')MATLAB displays ans = 0 (false), showing that Redraw is not an event.
Create a Microsoft® Excel® Workbook object.
myApp = actxserver('Excel.Application');
wbs = myApp.Workbooks;
wb = wbs.Add;Test the Activate event:
wb.isevent('Activate')MATLAB displays ans = 1 (true), showing that Activate is an event.
Test Save :
wb.isevent('Save')MATLAB displays ans = 0 (false), showing that Save is not an event; it is a method.
events (COM), eventlisteners, registerevent, unregisterevent, unregisterallevents
![]() | isequalwithequalnans | isfield | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |