"greying out" components

Is there a way to deactivate components (sliders, specifically), such that they are still visible, but are greyed-out and the user cannot interact with them?

 

Thanks!

Component::setEnabled

Component::setEnabled() is what I was searching for!