I have some nested SplitContainers and there is one undesired behaviour happening. Every time the splitter moves, the controls get their text selected (the text gets highlighted), specially the ComboBoxes.
I don’t know why thios happens. The problem is fairly easy to reproduce. You just need to:
- Create the form.
- A put a split container in it.
- Add a ComboBox with some items.
- Anchor the left and right sides of the ComboBox.
- Compile
- Move the Splitter
You will see that the ComboBox will have its text highlighted.
How can I prevent this from happening? Or at least, remove the highlight from the ComboBoxes?
Thanks a lot for your help!
This is an age-old bug in the Windows native combobox control. Yes, it selects the text when it gets the WM_SIZE message. This is specific to DropDownStyle = DropDown.
This is a possible workaround: