MATLAB: How to set an ActiveX Control to rescale with the figure window that contains it

activexcontrolguideMATLABnormalizedrescaleresizeunits

I have created a figure or a GUI containing an ActiveX control. When I resize the figure window, I would like the ActiveX control to similarly change its size. How can I do this?

Best Answer

There are two ways to perform this task, depending on how you have created the ActiveX control.
If you are using the GUIDE interface:
1) Go to the GUIDE menu bar and select
Tools -> GUI Options...
2) Change the "Resize behavior:" to "Proportional" and press "OK".
3) Save your GUI.
On the other hand, if you are using the ACTXCONTROL function from the command line, then please follow these steps:
1) Pass a second output argument to the ACTXCONTROL command, similar to:
[a, c] = actxcontrol('mscal.calendar');
2) Set the 'Units' property of the control to 'normalized' by executing the following command:
set(c,'units','normalized');
where "c" is the second output argument from the previous step.