MATLAB Sample ActiveX Control mwsamp

MATLAB® includes an example COM control that draws a circle on the screen, displays some text, and fires events when the user single- or double-clicks the control.

Create the control by running the mwsamp function in the matlabroot\toolbox\matlab\winfun folder, or type:

h = actxcontrol('mwsamp.mwsampctrl.2',[0 0 300 300]);

This control is in the folder with its type library. The type library is a binary file used by COM tools to decipher the capabilities of the control.

Display the events for this control.

allEvents = events(h)
allEvents = 

         Click: 'void Click()'
      DblClick: 'void DblClick()'
     MouseDown: 'void MouseDown(int16 Button, int16 Shift, Variant x, Vari...'
    Event_Args: 'void Event_Args(int16 typeshort, int32 typelong, double t...'

allEvents is a structure array. Each field of the structure is the name of an event handler and the value of that field contains the signature for the handler routine. For example:

allEvents.MouseDown
ans =

void MouseDown(int16 Button, int16 Shift, Variant x, Variant y)

See Also

Related Examples

More About