我想自定义WPF组合框箭头位置,如
我谷歌吧。但我无法得到任何正确答案。
如何自定义组合框箭头?
答案 0 :(得分:5)
正如@RohitVats暗示的那样,您需要为ControlTemplate
控件定义新的ComboBox
。您可以在MSDN上的Customizing the Appearance of an Existing Control by Using a ControlTemplate文章中了解如何定义新的ControlTemplate
。一个好的起点是实现默认的ControlTemplate
,然后根据需要自定义它。您可以在MSDN上的ComboBox Styles and Templates页面中找到ControlTemplate
的默认ComboBox
。
在默认ControlTemplate
内,您会看到为名为ControlTemplate
的{{1}}控件定义ToggleButton
。在ComboBoxToggleButton
中,您会找到名为ControlTemplate
的<{1}} ... ,是您要替换的部分:
Path
答案 1 :(得分:1)
<Path.LayoutTransform>
<RotateTransform Angle="270" ></RotateTransform>
</Path.LayoutTransform>
这是最简单的旋转方式