Hi
Are you aware that when a UltracomboEditor is set readonly then the before exit edit mode fires? this does not make sense to me because if it is read only you cant edit it in the first place.
Thanks
Paul
Hi Paul,
"Edit" mode is probably poorly named. It's a product of the edit infrastructure which was added to the control more than 15 years ago. It's actually not related to editing or the ability to edit. It really means is that the control has focus and is displaying a child TextBox that contains the value. So it actually does enter and leave edit mode even with it's ReadOnly. ReadOnly just means that the TextBox which is displayed is also set to ReadOnly and you can't change the text.
Hi Mike
It's not a problem for me now. I have coded around it. It is for security, we set controls to read only but then I discovered that event was still firing which caused an issue in every form I have done because there is code in the before exit edit mode.
I have simply changed from read only to disabled and made the controls look the same as read only in my security module rather than have to test/edit all before exit edit mode code.
Yeah, I can see how that could be a trap. If you have code in the Before/AfterExitEditMode events, you might reasonably expect it to fire only when the user edits the text, but that's not how it actually works. Setting Enabled to false will prevent the control from entering edit mode in the first place, so that seems like a good solution.