Alternative to WPF combo box dropdownstyle
In system.windows.forms, a combo box had a DropDownStyle. Unfortunately, I hate the style of a readonly combo box in WPF, an开发者_StackOverflow社区d there is no longer the ability to set the DropDownStyle/FlatStyle to is there an easy way to simply never use the ugly gray "button"-looking combo box and always use the appearance as though it is a text box with a drop down arrow?
I hope I'm making sense... Accomplishing this seems way more difficult than it should be.
Thank you!
Toggle IsEditable
and that will give you the style right away.
<ComboBox IsEditable="True">
<!-- items -->
</ComboBox>
If you don't want the text box to be editable, also set IsReadOnly
:
<ComboBox IsEditable="True" IsReadOnly="True">
<!-- items -->
</ComboBox>
The text in the text box still highlights when you select something, but it can't be edited as it's read-only.
精彩评论