I've been having problems with the ComboBox control. I'm no expert in GUI, but I know this problem is related to the control's focus.
For some reason, the ComboBox does not lose its focus when I click outside of it. Say for example:
OR
Note that the ComboBox only has the DropDownStyle set to ComboBoxStyle.DropDownList. This means that it's the default ComboBox behavior. I thought that the default behavior was that the ComboBox would lose its focus when you clicked out of it, or on another control (button or ComboBox). It is not the case here, why?
UPDATE: What I need is some sort of ActiveComponent = null. The behavior should be similar to the one of Visual Studio were you select Debug or Release (ComboBox) in the standard toolbar. Currently, if I click outside of the ComboBox, it is still focused.
You may want to take a look at This topic. Try setting CausesValidation to false on the combo box, see if you can leave it. If an exception is thrown in the OnValidating event handler, it won't deselect the box.
Are you sure the problem isn't because neither your frame or your other combobox have a way to gain focus?
All you have to do is:
The property is intended for some other purpose but it works for this scenario too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With