Specifications

Programming Callbacks for GUI Components
4-17
ActiveX Controls
You can insert an ActiveX control into your GUI if you are running MATLAB
on Microsoft Windows. When you drag an ActiveX component from the
component palette into the layout area, GUIDE displays a dialog in which you
can select any registered ActiveX control on your system. When you select an
ActiveX control and click
Create, the control appears as a small box in the
Layout Editor. You can then program the control to do what you want it to.
See MATLAB COM Client Support in the online MATLAB documentation to
learn more about ActiveX controls.
This section covers the following topics:
“Adding an ActiveX Control to a GUI” on page 4-17
“Viewing the ActiveX Properties with the Property Inspector” on page 4-19
“Adding a Callback to an ActiveX Control to Change a Property” on page 4-20
“Adding a Uicontrol to Change an ActiveX Control Property” on page 4-21
“Viewing the Methods for an ActiveX Control” on page 4-23
Adding an ActiveX Control to a GUI
This section shows how to add an ActiveX control to a GUI. The section
describes a simple ActiveX control that displays a circle. After adding the
ActiveX control, you can program the GUI to change the radius of the circle and
display the new value of the radius.
Note If MATLAB is not installed locally on your computer — for example, if
you are running MATLAB over a network — you might not find the ActiveX
control described in this example. To register the control, see Registering
Controls and Servers in the online MATLAB documentation.
To make the example,
1 Open a new GUI in GUIDE and drag an ActiveX control from the component
palette into the Layout Editor.