I have some DomainUpDown controls in my application. The behaviour is set like this:
- Normal: Each control can individually goes Up/Down (Change selected item)
- Special: If a check box is checked, Up/Downing the first control will cause the other controls to change as well
Now there are some cases that I want some of the controls to be disabled by setting Disabled = true. I did it, but in this case changing the selected item of the first control will cause the other disabled controls to change the selected item as well.
Is there a way to completly disable a control so it does not accepts something like control.Text = "bla bla" ?
P.S: I need not to hide the control!
One way:
You can hold a list of Textbox.Text values, which will hold entries for all of your textboxes.
Upon
OnTextChanged:if your textbox is enabled – update it’s
textproperty and store it up in the list.if your textbox is disabled – set it’s text
propertyto the last value you had in your list.You can use a
Dictionaryor anything similar that containKeyValuePairobjects.