External Interfaces Reference |
Display graphical interface for creating an ActiveX control
Syntax
Description
h = actxcontrolselect
displays a graphical interface that lists all ActiveX controls installed on the system and creates the one that you select from the list. The function returns a handle h
for the object. Use the handle to identify this particular control object when calling other MATLAB COM functions.
[h, info] = actxcontrolselect
returns the handle h
and also the 1-by-3 cell array info
containing information about the control. The information returned in the cell array shows the name, programmatic identifier (or ProgID), and filename for the control.
The actxcontrolselect
interface has a selection panel at the left of the window and a preview panel at the right. Click on one of the control names in the selection panel to see a preview of the control displayed. (If MATLAB cannot create the control, an error message is displayed in the preview panel.) Select an item from the list and click the Create button at the bottom.
Remarks
Click the Properties button on the actxcontrolselect
window to enter nondefault values for properties when creating the control. You can select which figure window to put the control in (Parent field), where to position it in the window (X and Y fields), and what size to make the control (Width and Height).
You can also register any events you want the control to respond to and what event handling routines to use when any of these events fire. Do this by entering the name of the appropriate event handling routine to the right of the event, or clicking the Browse button to search for the event handler file.
Note If you encounter problems creating Microsoft Forms 2.0 controls in MATLAB or other non-VBA container applications, see Using Microsoft Forms 2.0 Controls in the External Interfaces documentation. |
Examples
Select Calendar Control 9.0
in the actxcontrolselect
window and then click Properties to open the window shown above. Enter new values for the size of the control, setting Width to 500
and Height to 350
, then click OK. Click Create in the actxcontrolselect
window to create the control.
The control appears in a MATLAB figure window and the actxcontrolselect
function returns these values:
Expand the info
cell array to show the control name, ProgID, and filename:
info{:} ans = Calendar Control 9.0 ans = MSCAL.Calendar.7 ans = D:\Applications\MSOffice\Office\MSCAL.OCX
See Also
actxcontrollist | actxserver |
© 1994-2005 The MathWorks, Inc.