如何创建一个组WPF无线电菜单项? [英] How can I create a group of radio menu items in WPF?
本文介绍了如何创建一个组WPF无线电菜单项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
WPF似乎缺乏一个 RadioMenuItem
类或类似的功能。在 Windows.Forms的
,菜单项有一个 RadioChecked
属性,但WPF菜单项只有器isChecked
。我可以把实际的单选
S在一个菜单项
,但这种感觉怪怪的,看起来很尴尬。
WPF seems to be lacking a RadioMenuItem
class or similar functionality. In Windows.Forms
, menu items had a RadioChecked
property, but WPF menu items only have IsChecked
. I can put actual RadioButton
s in a MenuItem
, but this feels weird and looks awkward.
如何创建一组功能类似在WPF菜单单选按钮菜单项?仅供参考,请在IE8的缩放菜单。
How can I create a group of menu items that function like radio buttons in a WPF menu? For reference, see the "Zoom" menu in IE8.
推荐答案
修改的模板
的菜单项显示标准显示的单选按钮,而不是
Change the Template
of the MenuItem to display a RadioButton instead of the standard display
这篇关于如何创建一个组WPF无线电菜单项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文