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.

events

List of events COM object can trigger

Syntax

S = events(c)

Description

example

S = events(c) returns information about registered and unregistered events for COM object c.

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

Examples

List Control Events

Create an mwsamp control and list all events.

f = figure('position',[100 200 200 200]);
h = actxcontrol('mwsamp.mwsampctrl.2',[0 0 200 200],f);
events(h)
Click = void Click()
DblClick = void DblClick()
MouseDown = void MouseDown(int16 Button, int16 Shift,
  Variant x, Variant y)
Event_Args = void Event_Args(int16 typeshort, int32 typelong,
  double typedouble, string typestring, bool typebool)

Assign the output to a variable and display one field of the returned structure.

ev = events(h);
ev.MouseDown
ans =
  void MouseDown(int16 Button, int16 Shift, Variant x, Variant y)

List Workbook Events

Open a Microsoft Excel® application and list all events for a Workbook object.

myApp = actxserver('Excel.Application');
wbs = myApp.Workbooks;
wb = Add(wbs);
events(wb)

Input Arguments

collapse all

COM object, specified as a function handle.

Output Arguments

collapse all

Information about registered and unregistered events known to the COM object, returned as a structure array. The array contains the function prototype used to call the event handler routine. For each array element, the structure field is the event name and the contents of that field is the function prototype for the handler of that event.

Introduced before R2006a