c# – WPF:如何让Radiobuttons显示为ToggleButtons的水平行
发布时间:2020-12-15 17:48:01 所属栏目:百科 来源:网络整理
导读:我目前正在构建一个将用于触摸屏的UI.因此,我想将任何RadioButton组显示为ToggleButtons的水平行.我已经想出了如何显示ToggleButtons而不是标准项目符号: Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource
我目前正在构建一个将用于触摸屏的UI.因此,我想将任何RadioButton组显示为ToggleButtons的水平行.我已经想出了如何显示ToggleButtons而不是标准项目符号:
<Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource {x:Type ToggleButton}}"> 但是,这将显示一列ToggleButtons,而不是一行. 非常感谢! 解决方法
将单选按钮放在StackPanel中,并将Orientation设置为Horizo??ntal.
<StackPanel Orientation="Horizontal"> <RadioButton Content="1"/> <RadioButton Content="2"/> <RadioButton Content="3"/> </StackPanel > (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |