External Interfaces/API | ![]() ![]() |
Move and/or resize an ActiveX control in its parent window.
Syntax
move(h, pos)
Arguments
h
A MATLAB ActiveX control object.
pos
Returns
Description
move(h, position)
moves the control to a new position;position = move(h)
returns the current position.
Example
This example moves the control.
h = actxcontrol('MWSamp.mwsampctrl.1'); move(h, [100 100 200 200]); pos = move(h); % pos should be [100 100 200 200]
This example resizes the control to always fill the figure. Execute the following in MATLAB or in some M-file:
f = figure('Position', [100 100 200 200]); h = actxcontrol('MWSAMP.MwsampCtrl.1', [0 0 200 200]); set(f, 'ResizeFcn', 'resizectrl')
Create the script resizectrl.m
that contains
% Get the new position and size of the figure window fpos = get(gcbo, 'position'); % Resize the control accordingly move(h, [0 0 fpos(3) fpos(4)]);
![]() | load | propedit | ![]() |