Enabling/disabling all components in a form

Nice solution and super fast.

Other suggestions that do the same might be:

 def enable_edit(self):
  disablable_components = (Button, TextBox, CheckBox, DropDown, TextArea, RadioButton)
  for item in dir(self):
    comp = getattr(self, item)
    if type(comp) in disablable_components:
      comp.enabled = True
 def enable_edit(self):
  disablable_components = (Button, TextBox, CheckBox, DropDown, TextArea, RadioButton)
  for item in dir(self):
    comp = getattr(self, item)
    if any(isinstance(comp, anvil_comp) for anvil_comp in disablable_components):
      comp.enabled = True
 def enable_edit(self):
  for item in dir(self):
    comp = getattr(self, item)
    enabled = getattr(comp, 'enabled', None)
    if enabled is not None:
      comp.enabled = True
1 Like