User`s guide
Table Of Contents
- Getting Started
 - Using Instrumentation in a Model
 - Categories of ActiveX Controls
 - Placing ActiveX Controls in a Different Window
 - Library Reference
 - Index
 

Using Your Own ActiveX Control
3-35
Additionally, you can choose an event on your control through which you want 
to open the property editor. For example, write an M-file function to open the 
property editor (or whatever you want the event to do). The function must take 
multiple arguments, of which the first one will be the handle to the ActiveX 
control. For example, a simple function to open the property editor of a control 
would look like this:
function axeventhandler(varargin)
propedit(varargin{1})
Next enter an event with the handler you just wrote in the Other Events and 
Handlers
 parameter field. Assume the keypress event is valid, the event and 
handler entry would look like this:
{'keypress','axeventhandler'}
To use the error-checking code already written for the Dials & Gauges 
Blockset, you can use the same handlers we use by entering 
ax_block_dclk for 
events that should open the property editor (note that the editor will not open 
when the simulation is running). For example, to make a keystroke open the 
property editor (assuming the 
keypress event isvalid), enter the event and 
handler pair as follows:
{'keypress','ax_block_dclk'}
Colors of ActiveX Control Blocks
ActiveX Control blocks that try to determine their color by inheriting from the 
window in which they reside will not work properly in Simulink. More 
specifically, ActiveX Control blocks that send the 
WM_CTLCOLOR message to their 
parent have this problem. 
WM_CTLCOLOR is a Microsoft Windows message sent 
by an ActiveX Control block to allow the parent container to determine the 
color used by the control.
Caution Placing one of these controls in the ActiveX Control block will cause 
MATLAB and Simulink to crash.










