【问题标题】:Getting a WPF RadioButton to display as a bullet让 WPF RadioButton 显示为项目符号
【发布时间】:2015-07-13 14:24:07
【问题描述】:

这个让我发疯。如何显示一个 WPF RadioButton 看起来像一个子弹(代码 - 隐藏)

使用 .Content 我可以将其作为图像或文本框(如果选中则突出显示)。尝试获取带有一些文本的标准单选按钮

这适用于图像

 Dim SortIDUpRB As New RadioButton
            With SortIDUpRB
                .GroupName = "IDRB"
                .Name = "Prospects_SortIDUpRB"
                .ToolTip = "Sort records in descending order"
                .Content = ReturnToolBarImage("Arrow_Up.png")
            End With
            RegisterControl(Prospects_Grid, SortIDUpRB)
            SortToolBar.Items.Add(SortIDUpRB)

            Dim SortIDDown As New RadioButton
            With SortIDDown
                .GroupName = "IDRB"
                .Name = "Prospects_SortIDDownRB"
                .ToolTip = "Sort records in ascending order"
                .Content = ReturnToolBarImage("Arrow_Down.png")
                .IsChecked = True
            End With
            RegisterControl(Prospects_Grid, SortIDDown)
            SortToolBar.Items.Add(SortIDDown)
            SortToolBar.Items.Add(TS_Separator)

...但是我可以让一个显示为标准子弹吗???

谢谢

【问题讨论】:

    标签: .net wpf vb.net


    【解决方案1】:

    我想通了-希望对其他人有所帮助

                Dim SortIDCB As New RadioButton
                With SortIDCB
                    .Width = 16
                    .Height = 16
                    .Margin = New Thickness(2.5, 0, -2.5, 0)
                    .Content = SortIDString
                    .ToolTip = "Sort by ID"
                    .Name = "Prospects_SortIDCB"
                End With
                RegisterControl(Prospects_Grid, SortIDCB)
                'SortToolBar.Items.Add(SortIDCB)
    
                Dim BC As New System.Windows.Controls.Primitives.BulletDecorator
                With BC
                    .Child = SortIDCB
                End With
                SortToolBar.Items.Add(BC)
    

    【讨论】:

      猜你喜欢
      • 2012-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多