Documentation

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.

actxcontrol

Create Microsoft ActiveX control in figure window

Syntax

c = actxcontrol(progid)
c = actxcontrol(progid,Name,Value)

Description

example

c = actxcontrol(progid) creates an ActiveX® control in a figure window. The programmatic identifier (progid) for the control determines the type of control created. For the value, see the documentation provided by the control vendor. The returned object c is the default interface for the control.

You cannot use an ActiveX server for the progid because MATLAB® cannot insert ActiveX servers in a figure. For information about using ActiveX servers, see actxserver.

c = actxcontrol(progid,Name,Value) creates a control using name-value pair arguments.

Examples

collapse all

c = actxcontrol('mwsamp.mwsampctrl.2',[0 0 200 200]);
events(c)
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, ustring typestring, bool typebool)

Input Arguments

collapse all

Programmatic identifier, specified as a character vector. Get the Programmatic identifier from the control or server vendor documentation. For the progid values for MATLAB, see Programmatic Identifiers.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: actxcontrol('progid','position',[0 0 200 200],'parent',gcf)

collapse all

MATLAB position vector specifying the position of the control in an integer vector, specified as the comma-separated pair consisting of 'position' and an integer vector. The format is [left, bottom, width, height] using pixel units.

Example: 'position',[0 0 200 200]

Parent figure, model, or Command Window, specified as the comma-separated pair consisting of 'parent' and a handle.

Example: 'parent',gcf

Name of the event handler, specified as the comma-separated pair consisting of 'callback' and a character vector or cell array of character vectors. To use the same handler for all events, specify a single name. To handle specific events, specify a cell array of event name/event handler pairs.

Example: 'callback',{`Click' 'myClickHandler';'DblClick' 'myDblClickHandler';'MouseDown' 'myMouseDownHandler'

File name, specified as the comma-separated pair consisting of 'filename' and a character vector, containing the initial conditions of the previously saved control.

License key to create licensed ActiveX controls that require design-time licenses, specified as the comma-separated pair consisting of 'licensekey' and a character vector. For information on how to use controls that require run-time licenses, see Deploy ActiveX Controls Requiring Run-Time Licenses.

Limitations

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

Tips

  • When you no longer need the control, call release to free memory and other resources used by the interface. Releasing the interface does not delete the control itself. To release the interface, use the delete function. For an example event handler, see the file sampev.m in the toolbox\matlab\winfun\comcli folder.

  • For information about creating Microsoft Forms 2.0 controls in MATLAB or other non-VBA container applications, see Microsoft Forms 2.0 Controls.

Introduced before R2006a

Was this topic helpful?