You could so the following to disable all the controls in the panel at once.
dlgMain.pnlLayer.enabled = false;
But that doesn't change the look of the controls and the user may not understand that the controls are disabled. When a control's enable property is set to false the control 'dims' or gives some other sign the control is disabled. I think it would be better to create a function where you can enable/disable all child controls of the panel with one statement.
Thanks. I tried this on panel, group and checkbox and got error that
enabled() is not a funtion..
can you please elaborate how to do this or how to change the dims ?
enabled is a property, not a method, so it's dlgMain.pnlLayer.enabled = false; not dlgMain.pnlLayer.enabled(false ); or dlgMain.pnlLayer.enabled() = false;
I am just trying to understand - why would you want to disable a panel but not by hiding it?
EDIT: it looks like I was wrong about the controls not being 'dimed'. A quick test setting enabled to false on both a panel or a group does disable(dims) all the child controls.
Thanks Michael! I will try it at work
The reason I want to disable, and not hide is because it does not collapse and looks ugly when I hide it
Is there a way to collapse in photoshop script so the other panels below it will move up? Or is there a tab or group with checkbox like SPF ?
Thanks MIchael and Paul, works like a charm.. How to mark it as answered ?