I have a combo that I have set to be ReadOnly. I also have a event handler for the combo's Validating event. I don't understand why it would fire since the data can't be changed. Since it is firing, I'm trying to deal with it in the Validating event. I set CANCEL to TRUE, but focus stays on the combo and the event fires again when I try to tab off of it. I tried setting focus to the next control, but the event still fires. Any ideas on how to deal with this?
Hello Rehemann,
Thank you for the update.In your scenarios I would recommend you to have a readOnly conditional check in the validation event ,the way you are doing in your code would be best option.
Please let me know if I may assist you further on this matter.
Thank you for the update.
In your scenarios I would recommend you to have a readOnly conditional check in the validation event ,the way you are doing in your code would be best option.
I set the control to ReadOnly at runtime depending on the scenario. I have a global event handler for it and the code is getting into that code every time. For the time being, I have added code to the Validated event that checks the ReadOnly property of the control and skips whatever code is in that event if it is ReadOnly. That is my workaround for now.
Thank you for posting to our forum.
I followed the instructions you have provided and able to reproduce the behavior you are describing.I created a sample of winCombo and set it as readOnly and now I handled validation event and now when I run the sample ,ever time when I am exiting the form validation event does fire.
I would like to say that this is default expected behavior .I tried performing my test with the Microsoft control too and found that controls did work the same , validation did fire for the readonly comboBox as well.
I would like to know why do you have validation event for the control which is readOnly?