I have a display only section of a form that includes a checkbox. When I set Locked=True on this UtraCheckEditor it still allows the user to click it, giving the invalid impression that they can change it there. I have found the same true on Checkbox.
Enabled = False causes a grayed-out look that I do not want.
Shouldn't Locked=True disallow user input?
Thanks! Great idea.
You could set the Appearance.BackColorDisabled and Appearance.ForeColorDisabled to prevent the appearance from changing when the control is disabled.
The enabled property changes the appearance, I just don't want to alow user inut. I can do it through code though, I am just surprised I have to.
Thanks for the responses.
Matthew Brown
Or use the Enabled property. :)
The Locked property isn't really a property on the control, but is rather an extender property that is added to every control through the .NET ControlDesigner class in order to prevent further design-time modifications. As such, since it doesn't exist on the control, it does not have any effect on the run-time behavior of said control; this is where the general .NET practice is to set Enabled to false, since it gives the user a visual indication that they cannot interact with the control.
If you do need to still prevent the user from checking the UltraCheckEditor without changing the visual appearance, you could cancel the BeforeCheckStateChanged event.
-Matt