MATLAB: How to prevent a background subsystem from opening

backgroundsimulinksubsystem

it's known that the only way to create colored backgrounds for block groups in Simulink is to create empty masked subsystems and place them behind the blocks ("Send to back") However, I've noticed that when I click on such a background, the contents of the subsystem open up (i.e. an empty white field, because the "background" subsystem is usually created without any blocks inside). Is it possible to prevent a subsystem from opening by clicking, so that nothing happens when a subsystem is clicked?

Best Answer

Just close the subsystem as soon as they open from "OpenFun" callback of subsystem. Goto Block Properies >> Callbacks >> OpenFcn and write
close_system(gcbh);
in OpenFcn callback